Skip to content

Commit b3952ce

Browse files
committed
fix(session-replay): Add detection for potential PII leaks disabling session replay (#6389)
(cherry picked from commit ab82dac)
1 parent c1254d8 commit b3952ce

30 files changed

+1850
-60
lines changed

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,39 @@
2929

3030
- Replace deprecated SCNetworkReachability with NWPathMonitor (#6019)
3131

32+
> [!Warning]
33+
> **Session Replay is disabled by default on iOS 26.0+ with Xcode 26.0+ to prevent PII leaks**
34+
>
35+
> Due to potential masking issues introduced by Apple's Liquid Glass rendering changes in iOS 26.0, Session Replay is now **automatically disabled** on apps running iOS 26.0+ when built with Xcode 26.0 or later. This is a defensive measure to protect user privacy and prevent potential PII leaks until masking is reliably supported.
36+
>
37+
> Session replay will work normally if:
38+
>
39+
> - Your app runs on iOS versions older than 26.0, OR
40+
> - Your app is built with Xcode versions older than 26.0, OR
41+
> - Your app explicitly sets `UIDesignRequiresCompatibility` to `YES` in `Info.plist`
42+
>
43+
> **Override (use with caution):** If you understand the PII risks and want to enable session replay anyway, you can set:
44+
>
45+
> ```swift
46+
> options.experimental.enableSessionReplayInUnreliableEnvironment = true
47+
> ```
48+
>
49+
> This experimental override option will be removed in a future minor version once the masking issues are resolved.
50+
51+
### Fixes
52+
53+
- Fix wrong Frame Delay when becoming active, which lead to false reported app hangs when the app moves to the foreground after being in the background (#6393)
54+
- Session replay is now automatically disabled in environments with unreliable masking to prevent PII leaks (#6389)
55+
- Detects iOS 26.0+ runtime with Xcode 26.0+ builds (DTXcode >= 2600)
56+
- Detects missing or disabled `UIDesignRequiresCompatibility`
57+
- Uses defensive approach: assumes unsafe unless proven safe
58+
- Add `options.experimental.enableSessionReplayInUnreliableEnvironment` to allow overriding the automatic disabling (#6389)
59+
3260
## 8.56.2
3361

62+
> [!Warning]
63+
> Session Replay in this version does not correctly mask views when built with Xcode 26 and running on iOS 26 with Liquid Glass, which may lead to PII leaks. Please upgrade to 8.57.0 or later, which automatically **disables session replay** in such environments.
64+
3465
### Fixes
3566

3667
- Fix crash from null UIApplication in SwiftUI apps (#6264)
@@ -40,6 +71,9 @@
4071
> [!Warning]
4172
> This version can cause runtime crashes because the `UIApplication.sharedApplication`/`NSApplication.sharedApplication` is not yet available during SDK initialization, due to the changes in [PR #5900](https://github.com/getsentry/sentry-cocoa/pull/5900), released in [8.56.0](https://github.com/getsentry/sentry-cocoa/releases/tag/8.56.0).
4273

74+
> [!Warning]
75+
> Session Replay in this version does not correctly mask views when built with Xcode 26 and running on iOS 26 with Liquid Glass, which may lead to PII leaks. Please upgrade to 8.57.0 or later, which automatically **disables session replay** in such environments.
76+
4377
### Fixes
4478

4579
- Fix potential app launch hang caused by the SentrySDK (#6181)
@@ -51,6 +85,9 @@
5185
> [!Warning]
5286
> This version can cause runtime crashes because the `UIApplication.sharedApplication`/`NSApplication.sharedApplication` is not yet available during SDK initialization, due to the changes in [PR #5900](https://github.com/getsentry/sentry-cocoa/pull/5900), released in [8.56.0](https://github.com/getsentry/sentry-cocoa/releases/tag/8.56.0).
5387

88+
> [!Warning]
89+
> Session Replay in this version does not correctly mask views when built with Xcode 26 and running on iOS 26 with Liquid Glass, which may lead to PII leaks. Please upgrade to 8.57.0 or later, which automatically **disables session replay** in such environments.
90+
5491
### Features
5592

5693
- Structured Logs: Flush logs on SDK flush/close (#5834)
@@ -133,6 +170,9 @@
133170

134171
## 8.55.1
135172

173+
> [!Warning]
174+
> Session Replay in this version does not correctly mask views when built with Xcode 26 and running on iOS 26 with Liquid Glass, which may lead to PII leaks. Please upgrade to 8.57.0 or later, which automatically **disables session replay** in such environments.
175+
136176
### Features
137177

138178
### Fixes
@@ -159,6 +199,9 @@
159199
> If your app does not need arm64e, you don't need to make any changes.
160200
> But if your app _needs arm64e_ please use `Sentry-Dynamic-WithARM64e` or `Sentry-WithoutUIKitOrAppKit-WithARM64e` from 8.55.0 so you don't have issues uploading to the App Store.
161201

202+
> [!Warning]
203+
> Session Replay in this version does not correctly mask views when built with Xcode 26 and running on iOS 26 with Liquid Glass, which may lead to PII leaks. Please upgrade to 8.57.0 or later, which automatically **disables session replay** in such environments.
204+
162205
### Features
163206

164207
- Add a new prebuilt framework with arm64e and remove it from the regular one (#5788)
@@ -182,6 +225,9 @@
182225

183226
## 8.54.0
184227

228+
> [!Warning]
229+
> Session Replay in this version does not correctly mask views when built with Xcode 26 and running on iOS 26 with Liquid Glass, which may lead to PII leaks. Please upgrade to 8.57.0 or later, which automatically **disables session replay** in such environments.
230+
185231
### Features
186232

187233
- Add experimental support for capturing structured logs via `SentrySDK.logger` (#5532, #5593, #5639, #5628, #5637, #5643)

Samples/SentrySampleShared/SentrySampleShared/SentrySDKOverrides.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ public enum SentrySDKOverrides: String, CaseIterable {
109109

110110
case disableMaskAllImages = "--io.sentry.session-replay.disable-mask-all-images"
111111
case disableMaskAllText = "--io.sentry.session-replay.disable-mask-all-text"
112+
113+
case enableInUnreliableEnvironment = "--io.sentry.session-replay.enable-in-unreliable-environment"
112114
}
113115
case sessionReplay = "Session Replay"
114116

@@ -323,7 +325,7 @@ extension SentrySDKOverrides.Performance {
323325
extension SentrySDKOverrides.SessionReplay {
324326
public var overrideType: OverrideType {
325327
switch self {
326-
case .disable, .disableViewRendererV2, .enableFastViewRendering, .disableMaskAllText, .disableMaskAllImages: return .boolean
328+
case .disable, .disableViewRendererV2, .enableFastViewRendering, .disableMaskAllText, .disableMaskAllImages, .enableInUnreliableEnvironment: return .boolean
327329
case .onErrorSampleRate, .sessionSampleRate: return .float
328330
case .quality: return .string
329331
}
@@ -411,7 +413,7 @@ extension SentrySDKOverrides.SessionReplay {
411413
public var ignoresDisableEverything: Bool {
412414
switch self {
413415
case .disable: return false
414-
case .disableViewRendererV2, .enableFastViewRendering, .disableMaskAllText, .disableMaskAllImages, .onErrorSampleRate, .sessionSampleRate, .quality: return true
416+
case .disableViewRendererV2, .enableFastViewRendering, .disableMaskAllText, .disableMaskAllImages, .onErrorSampleRate, .sessionSampleRate, .quality, .enableInUnreliableEnvironment: return true
415417
}
416418
}
417419
}

Samples/SentrySampleShared/SentrySampleShared/SentrySDKWrapper.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public struct SentrySDKWrapper {
6161
)
6262
let defaultReplayQuality = options.sessionReplay.quality
6363
options.sessionReplay.quality = SentryReplayOptions.SentryReplayQuality(rawValue: (SentrySDKOverrides.SessionReplay.quality.stringValue as? NSString)?.integerValue ?? defaultReplayQuality.rawValue) ?? defaultReplayQuality
64+
65+
// Allow configuring unreliable environment protection via SDK override.
66+
// Default to false for the sample app to allow testing on iOS 26+ with Liquid Glass.
67+
options.experimental.enableSessionReplayInUnreliableEnvironment = SentrySDKOverrides.SessionReplay.enableInUnreliableEnvironment.boolValue
6468
}
6569

6670
#if !os(tvOS)

Samples/Shared/feature-flags.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ schemeTemplates:
2222
"--io.sentry.session-replay.enable-fast-view-rendering": false
2323
"--io.sentry.session-replay.disable-mask-all-images": false
2424
"--io.sentry.session-replay.disable-mask-all-text": false
25+
"--io.sentry.session-replay.enable-in-unreliable-environment": false
2526

2627
# user feedback
2728
"--io.sentry.feedback.use-custom-feedback-button": false

0 commit comments

Comments
 (0)