Skip to Main Content

REACT NATIVE

Critical RCE Flaw in React Native CLI Exposes Dev Servers

A severe remote-code execution vulnerability in @react-native-community/cli allows attackers to run arbitrary OS commands via the Metro development server.

Read time
5 min read
Word count
1,172 words
Date
Nov 6, 2025
Summarize with AI

A significant remote-code execution flaw has been discovered in the @react-native-community/cli and its server API. This vulnerability enables attackers to execute arbitrary operating system commands through the Metro development server, which is the default JavaScript bundler for React Native applications. The issue stems from the server binding to all network interfaces by default and an insecure call to the 'open()' function within a third-party NPM package. Developers are urged to update to version 20.0.0 of cli-server-api immediately to mitigate the risk of remote command execution, which could lead to network compromise or malicious code injection.

Illustration of a software vulnerability. Credit: Shutterstock
🌟 Non-members read here

A significant remote-code execution (RCE) flaw has been identified in the widely used @react-native-community/cli and its associated server API. This critical vulnerability allows malicious actors to execute arbitrary operating system commands directly through the Metro development server, which serves as the default JavaScript bundler for React Native applications. The discovery highlights a serious security risk for developers, as simply launching the development server could inadvertently expose their machines to external threats.

The core of the problem lies in the server’s default configuration. While console messages indicate the server listens only on “localhost,” it actually binds to all network interfaces by default (0.0.0.0). This broad binding, combined with an insecure function call, creates a pathway for remote exploitation. Security researchers at JFrog have characterized this bug as a severe threat, particularly for developers actively engaged in React Native app creation.

Unpacking the Remote Code Execution Vulnerability

The newly discovered vulnerability, tracked as CVE-2025-11953, has been assigned a critical CVSS score of 9.8 out of 10. It impacts versions of @react-native-community/cli ranging from 4.8.0 through 20.0.0-alpha.2. This wide range of affected versions underscores the broad potential impact across the React Native developer community. The mechanism of exploitation is surprisingly straightforward, involving a dangerous combination of insecure defaults and a vulnerable third-party library.

Insecure Server Defaults and Vulnerable Functions

The Metro development server, when initiated by the CLI tool, exposes a specific HTTP endpoint: /open-url. This endpoint is designed to accept a URL parameter from a POST request. Critically, it then passes this received URL parameter directly to the open() function, which is part of an imported NPM package. On Windows operating systems, this interaction can lead to the spawning of an smd /c.. call, effectively enabling arbitrary command execution on the host machine.

The problem is compounded by a fundamental misconfiguration within the CLI itself. Despite displaying messages that suggest the server is listening exclusively on “localhost,” the underlying host values are often undefined. This oversight causes the server to default to listening on 0.0.0.0, thereby making it accessible from all external networks. This combination of an exposed, vulnerable endpoint and an insecure default network binding creates prime conditions for remote code execution—a rare and exceptionally dangerous flaw for a development-focused tool.

The Third-Party Code Challenge

Researchers noted that this vulnerability serves as a stark reminder that even seemingly straightforward RCE flaws, such as passing user input directly to the system shell, continue to surface in real-world software. This is especially true when the dangerous “sink function” — the part of the code that processes and potentially misuses user input — resides within third-party code. In this particular instance, the imported open function from an external NPM package proved to be the Achilles’ heel, demonstrating the inherent risks associated with integrating external libraries without rigorous security vetting.

While exploitation on Windows systems has been clearly demonstrated, allowing for full operating system command execution, the paths to exploit macOS and Linux environments are currently less clear. Nevertheless, the risk remains significant, and further research into these platforms is ongoing. Developers should not underestimate the potential for harm, regardless of their operating system, given the severity of the underlying flaw.

Immediate Actions for React Native Developers

Given the critical nature of this vulnerability, immediate action is paramount for all developers utilizing @react-native-community/cli or its bundled cli-server-api within their React Native projects. Timely updates and precautionary measures are essential to prevent potential exploitation and safeguard development environments. The stakes are high, as a successful attack could lead to severe consequences for development machines and potentially, the applications being built.

Checking for Vulnerable Versions and Updating

The first step for any developer is to verify if their current setup includes the vulnerable package versions. This can typically be done by running npm list within their project directory. The vulnerability has been addressed and fixed in version 20.0.0 of cli-server-api. Therefore, the most critical recommendation is to update to this patched version as quickly as possible. This update will close the /open-url endpoint’s vulnerability and correctly configure the server’s network binding.

Ignoring this update leaves development machines exposed to remote attackers who could potentially execute arbitrary commands. Such an intrusion could have far-reaching implications, including gaining broader access to the developer’s network, corrupting source code, or even injecting malicious payloads directly into an application’s build process. The compromised build could then distribute malware to end-users, creating a much larger security incident.

Mitigating Risk When Immediate Updates Are Not Possible

In situations where an immediate update to version 20.0.0 is not feasible, developers should implement a crucial temporary mitigation strategy. JFrog researchers advise restricting the development server to localhost explicitly. This can be achieved by passing the --host 127.0.0.1 flag when launching the development server. For instance, instead of npm start or npx react-native start, developers should use npx react-native start --host 127.0.0.1. This action limits the server’s accessibility, confining it to the local machine and significantly reducing its exposure to external networks.

While this temporary workaround can reduce immediate risk, it is not a substitute for applying the official patch. Continuous reliance on insecure practices, even with mitigation, leaves open doors for future vulnerabilities or misconfigurations. The advisory underscores the importance of integrating robust secure coding practices and leveraging automated security scanning tools throughout the development lifecycle. Identifying and remediating such easily exploitable flaws early in the development process is crucial to prevent them from reaching production environments, where their impact could be much more severe.

Broader Implications for Developer Ecosystem Security

The discovery of this critical flaw in React Native’s CLI is not an isolated incident but rather indicative of a broader and concerning trend within the software development landscape. Attackers are increasingly targeting developer ecosystems, recognizing them as high-value entry points into organizations and supply chains. This strategy allows malicious actors to compromise systems and projects before they even reach a production state, leading to widespread downstream effects.

The Evolving Threat Landscape in Development Tools

Recent years have seen a rise in sophisticated attacks targeting various aspects of the developer environment. This includes instances of malicious npm packages with hidden payloads being introduced into widely used libraries. These rogue packages can surreptitiously inject malware or backdoors into projects, affecting countless applications that depend on them. Similarly, there have been reports of deceptive “verified” IDE extensions, which, despite appearing legitimate, harbor malicious code designed to steal credentials, exfiltrate data, or inject malware.

These incidents highlight how trusted build tools and development components are being weaponized, transforming them into stealthy points of entry for attackers. The convenience and interconnectedness of modern development workflows, while boosting productivity, also create new vectors for attack. The React Native CLI flaw serves as a potent reminder that every component within the development chain—from core frameworks to third-party dependencies and IDE extensions—must be treated with extreme caution and subjected to continuous security scrutiny. Developers and organizations must adopt a proactive security posture, emphasizing continuous vigilance and robust security measures, to effectively counter these evolving threats and safeguard the integrity of their software supply chain.