Skip to main content
CVE Vulnerability Database

CVE-2025-3539: H3C Magic Router Command Injection RCE Flaw

CVE-2025-3539 is a critical command injection vulnerability in H3C Magic router series that enables remote code execution via HTTP POST requests. This article covers technical details, affected versions, and mitigation.

Updated:

CVE-2025-3539 Overview

CVE-2025-3539 is a command injection vulnerability affecting multiple H3C Magic series routers, including Magic NX15, Magic NX30 Pro, Magic NX400, Magic R3010, and Magic BE18000 running firmware up to V100R014. The flaw resides in the FCGI_CheckStringIfContainsSemicolon function processing requests to /api/wizard/getBasicInfo within the HTTP POST request handler. Attackers on the local network can manipulate input parameters to inject arbitrary operating system commands. The exploit has been publicly disclosed, increasing the likelihood of active abuse against unpatched devices.

Critical Impact

Adjacent-network attackers with low privileges can execute arbitrary commands on affected H3C Magic routers, leading to full device compromise and potential pivoting into internal networks.

Affected Products

  • H3C Magic NX15, Magic NX30 Pro, and Magic NX400 up to firmware V100R014
  • H3C Magic R3010 up to firmware V100R014
  • H3C Magic BE18000 up to firmware V100R014

Discovery Timeline

  • 2025-04-13 - CVE-2025-3539 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-3539

Vulnerability Analysis

The vulnerability exists in the FastCGI handler responsible for the router's initial setup wizard endpoint at /api/wizard/getBasicInfo. The FCGI_CheckStringIfContainsSemicolon function attempts to sanitize input by rejecting semicolons, but the check fails to filter other shell metacharacters that permit command chaining. An authenticated attacker on the adjacent network can craft an HTTP POST request containing shell operators to break out of the intended command context. Public technical documentation of this flaw is available in the GitHub Vulnerability Write-up.

Root Cause

The root cause is improper neutralization of special elements in downstream components [CWE-74]. The sanitization routine implements a denylist that only rejects the semicolon character while permitting other shell metacharacters such as backticks, pipes, and command substitution syntax. User-supplied fields from the wizard API are passed to a system shell without adequate validation, enabling arbitrary command execution as the web service account, typically root on embedded router platforms.

Attack Vector

Exploitation requires network adjacency, meaning the attacker must reside on the same LAN or Wi-Fi segment as the target router. The attacker sends a malicious HTTP POST request to /api/wizard/getBasicInfo with a payload embedding shell metacharacters in a parameter that reaches the vulnerable function. Because the endpoint is reachable during router setup and by low-privileged users, exploitation does not require administrator credentials. Successful exploitation grants command execution on the underlying Linux operating system.

Detection Methods for CVE-2025-3539

Indicators of Compromise

  • HTTP POST requests targeting /api/wizard/getBasicInfo containing shell metacharacters such as backticks, pipes, $(), &&, or || in the request body.
  • Unexpected outbound connections initiated by the router to external IP addresses following anomalous requests to the wizard API.
  • New or modified processes running under the router's web server context, including reverse shell binaries or download utilities like wget or curl.

Detection Strategies

  • Inspect network telemetry for POST requests to H3C Magic router wizard endpoints containing non-standard characters in JSON or form fields.
  • Enable verbose logging on network appliances to capture full HTTP request bodies destined for router management interfaces.
  • Correlate router-originated outbound traffic with prior LAN-side HTTP requests to identify command-and-control callbacks.

Monitoring Recommendations

  • Monitor administrative interfaces of consumer and SMB routers for authentication events and configuration changes from unexpected clients.
  • Baseline normal traffic patterns from router management IPs and alert on deviations such as new outbound protocols or destinations.
  • Track firmware version telemetry to identify devices remaining on vulnerable V100R014 or earlier releases.

How to Mitigate CVE-2025-3539

Immediate Actions Required

  • Upgrade affected H3C Magic routers to the latest firmware available from the H3C Software Download portal.
  • Restrict access to the router management interface to trusted administrative hosts and VLANs only.
  • Disable the setup wizard endpoint post-provisioning where the firmware supports doing so.

Patch Information

H3C has published product remediation guidance under H3C Theme Details #229784. Administrators should consult the vendor advisory for firmware versions that address CVE-2025-3539 and validate the upgrade path applicable to each affected model in their environment.

Workarounds

  • Segment router management VLANs so that untrusted LAN clients cannot reach the HTTP administration service.
  • Enforce strong, unique credentials on all router user accounts to raise the bar for adjacent-network exploitation.
  • Where feasible, block the /api/wizard/getBasicInfo path at an upstream network filter until firmware updates are applied.
bash
# Example: restrict router management to a dedicated admin subnet
# Replace 10.10.10.0/24 with your admin management subnet
iptables -A INPUT -p tcp --dport 80 -s 10.10.10.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
iptables -A INPUT -p tcp --dport 443 -s 10.10.10.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j DROP

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.