Severity:

HIGH RISK

(7.2)

OS Command Injection in D-Link DIR-823X set_ac_status

CVE-2026-2129

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

Impact:

Remote Code Execution on Network Device

Severity:

HIGH RISK

(7.2)

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

D-Link DIR-823X routers contain an OS command injection vulnerability in the /goform/set_ac_status endpoint, where request parameters are concatenated into system-level commands without proper sanitization.

A remote attacker can manipulate the ac_ipaddr, ac_ipstatus, or ap_randtime parameters to execute arbitrary commands on the device, potentially taking control of the router when its management interface is reachable.

Affected context

The issue arises in the web management interface of the D-Link DIR-823X (firmware 250416), specifically within the handler for /goform/set_ac_status.

It manifests when user-controlled parameters (ac_ipaddr, ac_ipstatus, ap_randtime) are passed to underlying shell or system utilities without strict validation or proper escaping.

The risk is most pronounced when the router's administration interface is exposed to untrusted networks or when an attacker can coerce an authenticated user to trigger malicious requests.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the router, targeting the /goform/set_ac_status endpoint.
  • Required access: Ability to send crafted requests to the management interface; in many deployments this requires network proximity or prior access to the LAN, and may require authentication depending on configuration.
  • Trigger point: Processing of ac_ipaddr, ac_ipstatus, or ap_randtime parameters within backend logic that builds shell commands.
  • Why exploitation is possible: The application constructs and executes shell commands using user-controlled input without robust validation, encoding, or the use of parameterized/argument-based execution APIs, enabling injection of additional commands.

Why this happens

This vulnerability stems from constructing shell commands by string concatenation with untrusted input and then executing them via system-level APIs.

Instead of treating ac_ipaddr, ac_ipstatus, and ap_randtime as data-only parameters, the backend logic appears to embed them directly into command lines executed by the operating system.

This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), and is closely related to CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where special characters and separators are not neutralized, allowing attackers to break out of the intended command structure.

Potential impact

  • Execution of arbitrary system commands on the router's underlying operating system.
  • Complete compromise of the router, including modification of configuration, DNS settings, and routing behavior.
  • Network traffic interception, redirection, or man-in-the-middle attacks against connected clients.
  • Use of the compromised router as a pivot point for further attacks within the local network.
  • Incorporation of the device into botnets or use in distributed denial-of-service (DDoS) campaigns.

General mitigation guidance

Effective mitigation centers on eliminating direct shell command construction from user-controlled input and enforcing strict input handling:

  • Replace shell-based operations with APIs that accept arguments as structured parameters rather than interpolated strings.
  • Apply strict input validation and whitelisting on all affected parameters, limiting them to expected formats (e.g., IP address syntax, bounded integers, enumerated status values).
  • Normalize and reject inputs containing shell metacharacters, control characters, or command separators, understanding that this should complement—not replace—safer execution patterns.
  • Run management processes with the least privileges necessary and segment the management interface from untrusted networks.
  • Adopt secure-by-default configurations that restrict remote administration to trusted networks or VPNs.

How teams detect issues like this

Detection efforts can focus on both code-level and runtime indicators:

  • Static analysis: Scan firmware or source code for uses of system(), popen(), exec*, or similar APIs that concatenate HTTP request parameters or query values into command strings.
  • Code review: Flag any logic that builds shell commands using string operations and integrates values derived from ac_ipaddr, ac_ipstatus, ap_randtime, or similar request fields.
  • Configuration and policy checks: Enforce secure coding guidelines that prohibit direct shell invocation with untrusted data and require parameterized execution patterns.
  • Runtime monitoring: Where feasible, monitor for anomalous outbound connections or unusual process executions originating from web management components, using lightweight host or network telemetry.

Sources

SourceLink
github.comgithub.com/master-abc/cve/issues/23
vuldb.comvuldb.com/?ctiid.344764
vuldb.comvuldb.com/?id.344764
vuldb.comvuldb.com/?submit.746935
dlink.comdlink.com/

Frequently asked

questions

It can be, but only if the router's management interface is exposed to the internet or reachable by the attacker. In many home and small-office setups, the admin interface is only accessible from the internal network, though misconfigurations or deliberate remote management settings may widen exposure.

That depends on how the router is configured. If the vulnerable endpoint is protected by authentication and no bypass exists, an attacker would need to obtain or reuse valid credentials or perform social engineering to get an authenticated user to trigger a crafted request. If the endpoint is accessible without authentication, the barrier is lower and simple network reachability may be sufficient.

Avoid building shell command strings from user input altogether. Use APIs or libraries that accept arguments as structured parameters, enforce strict whitelisting-based validation on every field, and ensure that privileged operations are performed with minimal necessary permissions.

Establish coding standards that forbid direct use of shell execution functions with user-controlled data, mandate input validation and canonicalization, and require security-focused code reviews around all management interfaces. Complement these practices with automated static analysis rules that flag risky patterns before firmware is shipped.

Find out what's already
exploitable in your codebase.