/

CVE-2025-55423

Severity:

CRITICAL RISK

(9.8)

OS Command Injection in ipTIME Router upnp_relay()

CVE-2025-55423

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-94

Impact:

Remote Code Execution on Router Firmware

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Multiple ipTIME router models contain a command injection flaw in the upnp_relay() function, where the controlURL parameter used for UPNP port-forwarding is passed directly to system() without proper validation.

An attacker who can influence the controlURL value may be able to inject arbitrary operating system commands, leading to full takeover of the router and its network traffic.

Affected context

This vulnerability occurs within the UPNP port-forwarding relay logic of certain ipTIME router firmware builds, specifically in the upnp_relay() function.

The risk is present when the router:

  • Exposes or processes UPNP control requests from local or upstream networks
  • Uses the controlURL value directly when building shell commands
  • Executes those commands via system() or similar OS interfaces

The issue is most critical in deployments where UPNP is enabled and reachable by untrusted or partially trusted clients.

Exploit preconditions

  • Attack surface: UPNP control interface / port-forwarding relay path on the router
  • Required access: Ability to send or influence UPNP requests that determine the controlURL value (often from the local network, and in some misconfigurations from external networks)
  • Trigger point: Invocation of upnp_relay() when processing port-forwarding information, where the crafted controlURL is incorporated into a system() call
  • Why exploitation is possible: User-controlled data (controlURL) is concatenated into a shell command string without validation, sanitization, or parameterization, allowing shell metacharacters to break out of the intended command context

Why this happens

The core issue is the unsafe construction and execution of shell commands with untrusted input inside router firmware.

In upnp_relay(), the controlURL value—derived from UPNP control messages—is treated as trusted and embedded directly into a command string passed to system().

This pattern maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), manifesting as OS command injection: attacker-supplied data is interpreted by the command processor as executable syntax instead of inert data.

The lack of input normalization, character whitelisting, or safe command-building APIs makes it possible for crafted controlURL values to inject and execute arbitrary commands with the privileges of the router process.

Potential impact

  • Arbitrary command execution on the router's underlying operating system
  • Complete compromise of router configuration (DNS settings, routing, firewall rules)
  • Persistent malware installation or backdoors on the device
  • Traffic interception, redirection, or man-in-the-middle attacks against connected clients
  • Use of the router as a node in botnets or for launching further attacks within the local network
  • Loss of confidentiality for network topology and connected device information

General mitigation guidance

Mitigations generally focus on treating all UPNP-derived values as untrusted and removing direct shell interpretation of user-controlled data.

Defensive patterns include:

  • Replacing raw system() calls with safer APIs that avoid the shell (e.g., direct system calls, library functions, or parameterized command execution)
  • Enforcing strict validation and canonicalization of UPNP parameters, including controlURL, using allowlists of expected formats and characters
  • Normalizing and constraining user input to fixed, well-defined tokens or IDs instead of arbitrary strings
  • Applying least-privilege principles to the process handling UPNP so that, if compromised, it has minimal ability to alter system-wide configuration
  • Providing configuration options to disable UPNP or limit it to known-safe network segments, reducing exposure if unsafe handling remains

How teams detect issues like this

Detection approaches can combine code-level and behavior-level analysis:

  • Static analysis: Search for uses of system(), popen(), or equivalent OS execution APIs where arguments are built from UPNP or other network-derived inputs; flag dynamic string concatenation patterns
  • Code review: Examine the UPNP handling and upnp_relay() logic for direct interpolation of controlURL and other user-controlled fields into shell commands; ensure all such paths are either removed or strictly sanitized
  • Firmware scanning: Use automated firmware analysis tools to identify command injection sinks and tainted data flows from network input to OS command execution
  • Runtime monitoring: Observe router logs and network activity for anomalous or unexpected command invocations originating from UPNP request handling, as well as unusual outbound connections from the router

Policy-based checks in CI/CD for embedded firmware source can enforce rules against unparameterized shell command execution with external input.

Sources

SourceLink
docs.google.comdocs.google.com/spreadsheets/d/1kryOFltCmnPJvDTpIrudgryt79uI4PWchuQ8-Gak24c/edit?usp=sharing
github.comgithub.com/0x0xxxx/CVE/blob/main/CVE-2025-55423/README.md
github.comgithub.com/0x0xxxx/CVE/blob/main/CVE-2025-55423/assets/affected_products_cve_format.json
iptime.comiptime.com/iptime/?pageid=4&page_id=126&dfsid=3&dftid=583&uid=25203&mod=document

Frequently asked

questions

Exploitability depends on how UPNP and related services are exposed. In many home or SOHO scenarios, any device on the local network that can send UPNP requests may be able to exploit the flaw. In misconfigured or bridged environments, exposure may extend beyond the local LAN.

Not necessarily. The vulnerable path resides in UPNP/port-forwarding handling, which is often unauthenticated at the router GUI level. The key requirement is the ability to influence UPNP messages that determine the controlURL value.

Remove or refactor all uses of system()-style APIs that incorporate network-supplied data. Where command execution is unavoidable, construct commands using safe, parameterized interfaces that avoid the shell, and strictly validate all inputs against rigid, positive security rules.

Adopt a security-by-design approach: treat all network parameters as untrusted, avoid shell invocation in request-handling paths, implement centralized input validation routines, and add automated checks in the development pipeline to detect command and code injection patterns early in the lifecycle.

Find out what's already
exploitable in your codebase.