Skip to content

fix: restore open-url browser links while respecting CVE-2025-11953#2814

Merged
thymikee merged 1 commit into
mainfrom
codex/fix-open-url-browser-links
Jun 25, 2026
Merged

fix: restore open-url browser links while respecting CVE-2025-11953#2814
thymikee merged 1 commit into
mainfrom
codex/fix-open-url-browser-links

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Fixes #2812 by replacing the ESM-only strict-url-sanitise dependency in /open-url with local URL validation that preserves normal React Native welcome-screen links while rejecting Windows shell metacharacter payloads.

Removes the dependency from cli-server-api and refactors the middleware tests around a reusable request helper.

Validation

  • yarn build
  • yarn test packages/cli-server-api/src/__tests__/openURLMiddleware.test.ts --runInBand -u
  • Verified against /Users/thymikee/Developer/RNCLI83: https://reactnative.dev/docs/tutorial returned 200 and opened Safari; https://evil.com?|calc.exe and https://example.com/?a=%¾TA% returned 400.

@thymikee

thymikee commented Jun 25, 2026

Copy link
Copy Markdown
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 (https://www.$(calc.exe).com/foo), Windows pipe separator (https://evil.com?|calc.exe), and env-var expansion/exfiltration (https://example.com/?a=%¾TA%). The focused middleware test passes with those cases plus the React Native welcome-screen links.

@thymikee thymikee marked this pull request as ready for review June 25, 2026 14:20
@thymikee thymikee force-pushed the codex/fix-open-url-browser-links branch from a04ee31 to 2233857 Compare June 25, 2026 14:34
@thymikee thymikee force-pushed the codex/fix-open-url-browser-links branch from 2233857 to 7771736 Compare June 25, 2026 14:41
@thymikee thymikee changed the title fix: restore open-url browser links fix: restore open-url browser links while respecting CVE-2025-11953 Jun 25, 2026
@thymikee thymikee merged commit 903b3c5 into main Jun 25, 2026
8 checks passed
@thymikee thymikee deleted the codex/fix-open-url-browser-links branch June 25, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URLs unable to open since v20.1.1

1 participant