Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
});
```

### Changes

- Default `mobileReplayIntegration({ networkCaptureBodies })` to `true`, matching the iOS and Android native SDK defaults ([#6372](https://github.com/getsentry/sentry-react-native/pull/6372))

### Fixes

- The Sentry Babel transformer no longer injects `@sentry/babel-plugin-component-annotate` unless `annotateReactComponents` is explicitly enabled ([#6347](https://github.com/getsentry/sentry-react-native/pull/6347))
Expand Down
18 changes: 11 additions & 7 deletions packages/core/src/js/replay/mobilereplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,18 @@

/**
* If request and response bodies should be captured for URLs matched by
* `networkDetailAllowUrls`. When `false` (the default), only headers are
* captured for allow-listed URLs — opt in explicitly to record bodies, since
* they can contain sensitive payloads.
* `networkDetailAllowUrls`. Enabled by default — set to `false` to capture
* only headers for allow-listed URLs when you cannot tolerate body payloads
* being recorded.
*
* Bodies are truncated at ~150 KB; truncated payloads include a
* `MAX_BODY_SIZE_EXCEEDED` warning.
* `MAX_BODY_SIZE_EXCEEDED` warning. URLs only enter the capture path after
* being explicitly allow-listed via `networkDetailAllowUrls`, so the
* default-on behaviour does not implicitly capture every request body.
*
* @default false
* Aligned with the iOS and Android native SDK defaults.
*
* @default true
*/
networkCaptureBodies?: boolean;

Expand Down Expand Up @@ -222,7 +226,7 @@
screenshotStrategy: 'pixelCopy',
Comment thread
sentry-warden[bot] marked this conversation as resolved.
networkDetailAllowUrls: [],
networkDetailDenyUrls: [],
networkCaptureBodies: false,
networkCaptureBodies: true,

Check warning on line 229 in packages/core/src/js/replay/mobilereplay.ts

View check run for this annotation

@sentry/warden / warden: code-review

Changing `networkCaptureBodies` default silently enables body capture for existing users

Existing users who have `networkDetailAllowUrls` configured but never set `networkCaptureBodies` will silently start recording request and response bodies after upgrading — this is a breaking behavioral change that can expose sensitive payloads without any user action.
networkRequestHeaders: [],
networkResponseHeaders: [],
};
Expand Down Expand Up @@ -388,7 +392,7 @@
const networkOptions: ResolvedNetworkOptions = {
allowUrls: options.networkDetailAllowUrls ?? [],
denyUrls: options.networkDetailDenyUrls ?? [],
captureBodies: options.networkCaptureBodies ?? false,
captureBodies: options.networkCaptureBodies ?? true,

Check warning on line 395 in packages/core/src/js/replay/mobilereplay.ts

View check run for this annotation

@sentry/warden / warden: code-review

[LGJ-2NU] Changing `networkCaptureBodies` default silently enables body capture for existing users (additional location)

Existing users who have `networkDetailAllowUrls` configured but never set `networkCaptureBodies` will silently start recording request and response bodies after upgrading — this is a breaking behavioral change that can expose sensitive payloads without any user action.
requestHeaders: options.networkRequestHeaders ?? [],
responseHeaders: options.networkResponseHeaders ?? [],
};
Expand Down
Loading