Summary
An OS command injection vulnerability in Create React App's react-dev-utils on macOS allows crafted input to be passed into the browser startup logic, resulting in arbitrary command execution.
When attacker-controlled values influence how startBrowserProcess constructs shell commands, remote exploitation becomes possible within development environments that expose this functionality.
Affected context
This vulnerability occurs within Create React App projects that rely on react-dev-utils to open a browser via the startBrowserProcess function on macOS.
It is relevant when user-controlled or otherwise untrusted data can flow into parameters used by openBrowser.js, particularly in environments where development tooling is exposed over a network or integrated into automated workflows.
The issue is more pronounced in shared or remote development setups, such as cloud IDEs, remote dev servers, or CI pipelines that invoke development scripts and run with elevated local privileges.
Exploit preconditions
- Attack surface: Development server or tooling that triggers the browser-opening behavior through react-dev-utils on macOS.
- Required access: Ability to supply or influence the input used by startBrowserProcess (for example, URLs, commands, or environment variables that get concatenated into shell invocations).
- Trigger point: Execution of scripts that call openBrowser.js, typically during
npm start, yarn dev runs, or other automated tooling that attempts to launch a browser. - Why exploitation is possible: The function constructs shell commands without adequately sanitizing or safely encoding untrusted values, allowing injection of additional shell metacharacters and commands (CWE-77/CWE-78).
Why this happens
The root cause lies in constructing shell commands using string concatenation or interpolation and then executing them through command-line invocation APIs that interpret shell syntax.
Instead of treating inputs as data, the implementation implicitly trusts values flowing into startBrowserProcess, allowing them to be parsed as part of a command line by the underlying shell.
This aligns with CWE-78 (Improper Neutralization of Special Elements used in an OS Command) and CWE-77 (Improper Neutralization of Special Elements used in a Command), where unvalidated or improperly escaped input is handed to command execution functions, enabling attackers to append or replace intended commands.
Potential impact
- Attackers may execute arbitrary OS commands on the developer machine or remote dev environment.
- Malicious commands could install or run malware, steal local credentials, or exfiltrate source code and secrets.
- Development environments, CI runners, or build agents can be fully compromised if they trigger vulnerable code with elevated privileges.
- Local configuration, project files, and caches may be modified, leading to subtle backdoors in application code or dependencies.
General mitigation guidance
Mitigation patterns focus on removing direct shell command construction and ensuring that any required process execution treats arguments as data, not executable syntax.
Common strategies include using APIs that bypass the shell and pass arguments as structured parameters, enforcing strict validation and whitelisting of any values included in command invocations, and avoiding dynamic composition of command lines from user-supplied or environment-sourced input.
Running development tools with least privilege, isolating them in constrained environments, and treating local dev scripts as part of the attack surface can further reduce risk when command execution functionality is necessary.
How teams detect issues like this
Detection often involves static analysis and code review targeting patterns where child_process, shell invocations, or platform-specific command wrappers are fed unsanitized strings.
Reviewers can look for string concatenation and interpolation in openBrowser.js and related utilities, especially where user input or configuration values are merged into command lines.
Policy-based checks in CI, such as automated scanning for unsafe command execution APIs or enforcing secure wrappers around them, can help identify similar issues before they reach wider use.

