Severity:

HIGH RISK

(7.2)

Command Injection in D-Link DWR-M921 USSD Configuration

CVE-2026-2085

Analyzed

Vulnerability type

Category:

Command Injection

CWE:

CWE-74, CWE-77

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 DWR-M921 firmware 1.1.50 contains a command injection vulnerability in the USSD configuration endpoint, where user-controlled input is passed into system commands without proper sanitization.

A remote attacker can exploit the ussdValue parameter in /boafrm/formUSSDSetup to execute arbitrary commands on the device, potentially gaining full control of the router.

Affected context

The vulnerability occurs in the web management interface of D-Link DWR-M921 routers running firmware version 1.1.50, specifically in the sub_419F20 function of /boafrm/formUSSDSetup.

It is exposed when the USSD configuration feature is reachable over the network and accepts user-supplied ussdValue input that is later incorporated into shell commands.

The issue is more impactful in deployments where the router's administration interface is accessible from untrusted networks or where default/weak credentials remain in use.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the router's web management panel.
  • Required access: Ability to send crafted requests to /boafrm/formUSSDSetup; in many setups this requires access to the admin interface, but misconfigurations may expose it more broadly.
  • Trigger point: Submission of the ussdValue parameter containing crafted command sequences as part of USSD configuration actions.
  • Why exploitation is possible: The ussdValue argument is concatenated or interpolated into an OS-level command without robust validation, sanitization, or safe command-building APIs, allowing attacker-controlled metacharacters to alter command structure.

Why this happens

This vulnerability stems from unsafe construction of shell commands using untrusted input in the sub_419F20 function.

Rather than treating ussdValue as opaque data, the implementation allows it to influence the structure of commands sent to the underlying operating system, aligning with CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') and CWE-74: Improper Neutralization of Special Elements in Output.

The core bug class is failure to neutralize shell metacharacters and to separate command logic from user data, enabling attackers to break out of the intended USSD handling and execute arbitrary instructions.

Potential impact

  • Execution of arbitrary system commands on the router.
  • Complete compromise of the device's configuration and management plane.
  • Installation of persistent malware or backdoors on the router.
  • Interception, modification, or redirection of network traffic passing through the device.
  • Use of the router as a pivot point for further attacks inside the local network.
  • Enrollment of the device into botnets for DDoS or other malicious activities.

General mitigation guidance

Mitigation typically focuses on isolating shell invocation from user input and enforcing strict validation of configuration parameters:

  • Treat all web-supplied parameters as untrusted and apply allowlist-based validation for ussdValue (e.g., permitted characters, length, and format aligned with valid USSD codes).
  • Avoid building shell commands through string concatenation; instead, use APIs that separate command and arguments, or dedicated libraries that do not invoke a shell.
  • Neutralize or reject input containing shell metacharacters, control characters, or unexpected tokens that are not valid in legitimate USSD requests.
  • Run web management processes and any helper utilities with least privilege to limit the blast radius if input validation fails.
  • Restrict network exposure of the management interface (e.g., disable WAN access, require VPN or management VLAN) and enforce strong authentication to reduce reachable attack surface.

How teams detect issues like this

Detection efforts can center on both code-level review and runtime monitoring:

  • Static analysis: Define rules that flag string concatenation or formatting of shell commands using request parameters (such as ussdValue), particularly in functions handling system or popen calls.
  • Code review: Look for handlers in /boafrm/formUSSDSetup and similar endpoints where user input is passed to shell utilities, checking for absence of allowlist validation and unsafe use of metacharacters.
  • Configuration and policy checks: Enforce internal development policies that prohibit direct shell invocation with unsanitized input and require the use of safe command-execution wrappers.
  • Runtime monitoring: Inspect router logs and network telemetry for anomalous USSD requests containing shell control characters (;, &&, |, backticks, etc.) and unusual command patterns.
  • Automated SAST and firmware analysis tools may help surface these patterns early, especially when integrated into product development or firmware security review workflows.

Sources

SourceLink
github.comgithub.com/LX-66-LX/cve-new/issues/1
github.comgithub.com/LX-66-LX/cve-new/issues/1#issue-3851345029
vuldb.comvuldb.com/?ctiid.344652
vuldb.comvuldb.com/?id.344652
vuldb.comvuldb.com/?submit.746400
dlink.comdlink.com/

Frequently asked

questions

Yes. If an attacker can reach the router's management endpoint exposing /boafrm/formUSSDSetup, they can attempt remote exploitation by sending crafted ussdValue parameters, subject to any authentication barriers in place.

In many realistic deployments, access to the USSD configuration endpoint is gated by the router's admin authentication. However, weak/default credentials, session fixation, CSRF scenarios, or misconfigurations that expose the interface to the internet can significantly reduce this barrier.

The most robust pattern is to eliminate direct shell usage for handling user-provided data: validate ussdValue against a strict allowlist of acceptable USSD formats, pass parameters as arguments to non-shell APIs, and encapsulate all command execution behind a minimal, well-defined interface that never concatenates user input into commands.

Adopt secure coding practices that treat all external input as untrusted, enforce centralized validation routines, and prohibit ad-hoc shell calls in web handlers. Combine these with regular security code reviews, static analysis focused on command execution sinks, and design-time decisions favoring higher-level APIs over raw shell invocation.

Find out what's already
exploitable in your codebase.