fix: restore open-url browser links while respecting CVE-2025-11953#2814
Merged
Conversation
Member
Author
|
Checked this against the 20.1.1 security change from #2758. This PR keeps the same regression coverage for CVE-2025-11953: non-string URLs are rejected, and the three attack vectors from #2758 are still rejected with 400: invalid hostname command substitution ( |
a04ee31 to
2233857
Compare
2233857 to
7771736
Compare
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
Fixes #2812 by replacing the ESM-only
strict-url-sanitisedependency in/open-urlwith local URL validation that preserves normal React Native welcome-screen links while rejecting Windows shell metacharacter payloads.Removes the dependency from
cli-server-apiand refactors the middleware tests around a reusable request helper.Validation
yarn buildyarn test packages/cli-server-api/src/__tests__/openURLMiddleware.test.ts --runInBand -u/Users/thymikee/Developer/RNCLI83:https://reactnative.dev/docs/tutorialreturned 200 and opened Safari;https://evil.com?|calc.exeandhttps://example.com/?a=%¾TA%returned 400.