Add headers validation check to prevent crash#55749
Closed
vzaidman wants to merge 3 commits into
Closed
Conversation
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 25, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
5a1eefa to
6b1b743
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 25, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
6b1b743 to
ca4c592
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
ca4c592 to
1d4a50e
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
e55f331 to
45995fd
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
45995fd to
b896796
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
b896796 to
4b6088c
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
3716811 to
55a6e3c
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
55a6e3c to
9432c15
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
9432c15 to
028fdd2
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
028fdd2 to
1b01bc1
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 26, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
4ff1d2e to
3f4c40e
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 27, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
added 2 commits
February 27, 2026 04:32
Summary: Add defensive check to validate the WebSocket URL before attempting to connect. This prevents potential crashes when an invalid or nil URL is passed to the WebSocket module, which could cause XPC serialization failures deep in the network stack. The crash was observed in during XPC serialization when SocketRocket attempted to open a connection with invalid URL data. Differential Revision: [to be generated] D94375527
Summary: Add defensive check to validate components.URL before using it to load cookies. If NSURLComponents fails to parse the URL or returns nil for components.URL, this prevents passing nil to cookiesForURL which could cause issues in the network stack. Differential Revision: D94375528
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 27, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
3f4c40e to
0a0c36a
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 27, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
0a0c36a to
3070628
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 27, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
c643da0 to
2b802f3
Compare
vzaidman
added a commit
to vzaidman/react-native
that referenced
this pull request
Feb 27, 2026
Summary: Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Differential Revision: D94375533
2b802f3 to
2083285
Compare
|
This pull request has been merged in e2fdf0f. |
zoontek
pushed a commit
to zoontek/react-native
that referenced
this pull request
Mar 9, 2026
Summary: Pull Request resolved: facebook#55749 Add defensive checks when processing custom headers to ensure: 1. Header keys are valid NSString instances before using them 2. Header values are successfully converted before adding to the request This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module. Changelog: [Internal] Reviewed By: javache Differential Revision: D94375533 fbshipit-source-id: 8af25eb2e2d5426e2bae5503a88cc5bc160b84cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add defensive checks when processing custom headers to ensure:
This prevents potential crashes when invalid header data (non-string keys or values that fail conversion) is passed from JavaScript to the WebSocket module.
Changelog: [Internal]
Differential Revision: D94375533