Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach DSL-2640B web CGI endpoint
-
DeliveryCraft request to portmapcfg.cmd
-
ExploitInject shell metacharacters into pmapCfgName
-
ExecutionFirmware executes attacker OS commands
-
ImpactFull device compromise and pivot
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires network reachability to the DSL-2640B management web interface and the ability to send a request to the portmapcfg.cmd CGI handler (function cgiPortMapQrySwitch) with a malicious pmapCfgName value containing shell metacharacters. The supplied CVSS vector indicates no authentication (PR:N) and no user interaction, implying exploitation against the exposed management interface without credentials; however, the available sources do not confirm whether the endpoint is reachable pre-authentication or whether remote (WAN-side) management must be enabled - on typical home-gateway deployments the admin CGI is reachable only from the LAN unless remote management is turned on, which materially limits internet-wide exposure. The practical limiting factors are therefore: management-interface exposure (LAN vs WAN), the specific firmware build 3.0.6.0.41, and the unverified pre-auth status. |
| Impact | The input CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N with high confidentiality, integrity and availability impact) describes a maximally severe, remotely reachable, unauthenticated OS command injection, and the vuln.today Decision label is act_now. A public PoC reference (GitHub) is listed but is not verified as working exploit code, and the input marks exploitation maturity as E:P (Proof-of-Concept) rather than active exploitation. This CVE is NOT in CISA KEV and no EPSS score is provided, so there is no signal of widespread automated exploitation yet - the elevated priority rests on the severe technical impact and the existence of a PoC, not on confirmed in-the-wild activity. One tension to verify: the provided vector asserts PR:N (no authentication), but the affected endpoint (portmapcfg.cmd / port-mapping configuration CGI) is the type of administrative function that on many D-Link gateways sits behind the web-admin login; the available sources do not state whether an authenticated session or a specific exposure (e.g. WAN-side management enabled) is required, so the true pre-authentication status should be confirmed against the device firmware. Net: treat as a high-priority fix for any exposed DSL-2640B, while recognizing the real-world blast radius is bounded by the product's small, likely end-of-life deployment footprint. |
| Exploit ScenarioDerived | A remote attacker reaches the DSL-2640B web management CGI and sends a crafted request to portmapcfg.cmd (function cgiPortMapQrySwitch) with shell metacharacters injected into the pmapCfgName argument, causing the firmware to execute attacker-supplied OS commands. Because the device runs this with high privilege, the attacker gains command execution on the router, enabling traffic interception, DNS hijacking or use as a pivot/botnet node. A public PoC reference exists on GitHub but is not verified as working exploit code, and per the CVSS vector no user interaction is needed. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Nov 29, 2026
OS command injection in the D-Link DSL-2640B home DSL router (firmware build 3.0.6.0.41) lets a remote attacker execute arbitrary shell commands through the portmapcfg.cmd CGI handler, specifically by supplying a crafted pmapCfgName value to the cgiPortMapQrySwitch function. The supplied CVSS 4.0 vector scores 9.3 with network reachability, no privileges and no user interaction, and high confidentiality, integrity and availability impact, though the sources do not confirm whether the endpoint is reachable before authentication or whether WAN-side management must first be enabled. A public PoC reference (a GitHub repository demonstrating the pmapcfgname injection) exists; it is not verified as working exploit code, and there is no CISA KEV confirmation of active exploitation, but the vuln.today decision label is act_now.
Earlier versions of this analysis (1)
OS command injection in the D-Link DSL-2640B at firmware 3.0.6.0.41 lets remote attackers push arbitrary shell commands into the router through the pmapCfgName argument of the cgiPortMapQrySwitch handler in portmapcfg.cmd, and the reporter's CVSS 4.0 vector rates it 10.0. The sources do not confirm whether a valid administrative session is required, although portmapcfg is a port-mapping configuration endpoint normally reached through the router's administrative web interface, so real exposure hinges on whether that interface is reachable from an untrusted network. There is no CISA KEV entry and no confirmed working exploit; a public PoC reference exists in a GitHub repository but it is not verified as working exploit code, and no fixed firmware version is indicated.
RemediationAI
No vendor-released patch is identified in the supplied data: the references point to the D-Link corporate site and to VulDB records, but no fixed firmware version is listed, so the exact remediated build cannot be stated and owners should treat firmware 3.0.6.0.41 as vulnerable pending confirmation from D-Link. Because exploitation requires network reachability to the portmapcfg.cmd CGI handler, the actionable exposure controls supported by the available evidence are reachability-based: disable remote (WAN-side) management so the administrative web interface is reachable only from the LAN, and, where the interface must remain enabled, restrict which hosts on the LAN can reach portmapcfg.cmd. The trade-off is that LAN-only access does not protect against a malicious or compromised device already on the internal network, and filtering the CGI path may break port-mapping and virtual-server configuration pages that depend on the same handler. Note that the supplied evidence does not confirm whether the handler is exploitable pre-authentication, so perimeter restrictions should not be dropped on the assumption that the admin login alone is sufficient.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is a classic OS command injection (CWE-78) in the administrative CGI surface of an embedded Linux-based consumer DSL gateway. The endpoint portmapcfg.cmd exposes a handler, cgiPortMapQrySwitch, that processes the pmapCfgName request argument; the evidence indicates that this value is incorporated into a shell command without adequate neutralization, so shell metacharacters in the parameter are interpreted by the underlying command interpreter and yield arbitrary command execution with the privileges of the CGI process. Because the handler is part of the router's web management application, the attack surface is the management HTTP interface rather than a routed data-plane service. The CPE entry cpe:2.3:a:d-link:dsl-2640b:*:*:*:*:*:*:*:* uses a wildcard version and therefore does not pin exposure to a firmware release; the only build named in the source data is 3.0.6.0.41. Two points remain unverified in the available evidence: whether cgiPortMapQrySwitch is reachable pre-authentication on this firmware, and whether the interface is exposed on the WAN side by default or only after remote management is enabled. The trigger path beyond the pmapCfgName argument is not described in the available sources.
Know when Dsl 2640B gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P
OS command injection reachable over the network with low complexity and no interaction; PR:N follows the only supplied vector though pre-auth status is unverified; command execution yields full C/I/A impact on the device.
Primary rating from Vendor (VulDB).
CVSS VectorVendor: VulDB
Lifecycle Timeline
3DescriptionCVE.org
A flaw has been found in D-Link DSL-2640B 3.0.6.0.41. The impacted element is the function cgiPortMapQrySwitch of the file portmapcfg.cmd of the component Endpoint. This manipulation of the argument pmapCfgName causes os command injection. The attack can be initiated remotely. The exploit has been published and may be used.
Technical POC Analysis
Classic CWE-78 OS command injection in the D-Link DSL-2640B web management CGI dispatcher /bin/cfm.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Latest POC
1 PoC candidate from github (unverified)
Sign in to open the public PoC links collected for this CVE.
Executive ViewAI
A critical command injection vulnerability (CVE-2026-138287) in D-Link DSL-2640B routers, potentially allowing remote code execution, poses a severe risk if exploited. Leadership should care because these devices often sit at network edges, and a compromise could lead to data breaches, service disruption, or use as a pivot point into other systems. While active exploitation is not confirmed, a public proof-of-concept reference exists, warranting immediate action.
No vendor-released patch identified at time of analysis; interim mitigations include disabling WAN-side management, restricting access to the affected CGI handler via firewall rules, and segmenting affected devices from critical assets.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
OS command injection in the D-Link DSL-2640B (firmware 3.0.6.0.41) WAN configuration handler allows an attacker who can
OS command injection in the IP Filter rule handler (scoutflt/scinflt) of D-Link DSL-2640B firmware 3.0.6.0.41 lets an at
Authenticated OS command injection in the DMZ Host handler (SecCfgMngr::setDmzHost) of D-Link DSL-2640B firmware 3.0.6.0
Cross-site request forgery (CSRF) vulnerability in redpass.cgi in D-Link DSL-2640B Firmware EU_4.00 allows remote attack
EUVD-2026-137799
GHSA-g5cv-72c5-jj3p
NVD
CVE.org
EPSS
VulDB
Exploit-DB