Fix OS command injection in openBrowser (CVE-2026-14802)#17274
Fix OS command injection in openBrowser (CVE-2026-14802)#17274vimalviswan wants to merge 1 commit into
Conversation
Use execFileSync so URLs with shell metacharacters cannot be interpreted when launching Chrome via AppleScript (CVE-2026-14802). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi @vimalviswan! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary
react-dev-utils/openBrowser.json macOS (CVE-2026-14802 / SNYK-JS-REACTDEVUTILS-17890708).execSyncwithexecFileSyncso URL arguments are never interpreted by/bin/sh(same approach as Security Fix for Command Injection #12590).Root cause
On Darwin,
startBrowserProcessbuilt anosascriptcommand string and passed it throughexecSync.encodeURI(url)does not escape shell-significant characters ($,(,)), so a crafted URL such ashttp://localhost/$(touch$IFS/tmp/...)could execute arbitrary commands when Chrome was already running.Fix
Test plan
npm test -- --testPathPattern=openBrowserinpackages/react-dev-utils(4 passing)openBrowser('http://localhost:3000')still reuses an existing tab$(...)/$IFSdoes not create side effects on disk when opened via the AppleScript pathCloses #17269