Skip to main content

D-Link DSL-2640B CVE-2026-138287

| EUVDEUVD-2026-137799 CRITICAL
OS Command Injection (CWE-78)
2026-11-29 VulDB GHSA-g5cv-72c5-jj3p
9.3
CVSS 4.0 · Vendor: VulDB
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach DSL-2640B web CGI endpoint
  2. Delivery
    Craft request to portmapcfg.cmd
  3. Exploit
    Inject shell metacharacters into pmapCfgName
  4. Execution
    Firmware executes attacker OS commands
  5. Impact
    Full 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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
1 PoC candidate (unverified) No patch listed yet 3.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – 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)
v1 Nov 29, 2026 - 17:06 CVSS 10.0

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

DSL-2640B 3.0.6.0.41

Affected Packages

euvd dsl_2640b no fix

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

Vendor (VulDB) PRIMARY 9.3 CRITICAL
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
vuln.today AI 9.8 CRITICAL

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.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulDB).

CVSS VectorVendor: VulDB

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

Lifecycle Timeline

3
Analysis Updated
Nov 29, 2026 - 17:27 vuln.today
v2 - CVSS changed
CVSS changed
Nov 29, 2026 - 17:22 NVD
10.0 (CRITICAL) 9.3 (CRITICAL)
CVE Published
Nov 29, 2026 - 16:30 cve.org
CRITICAL 10.0

DescriptionCVE.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

Why It Matters

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.

Business Impact: Severe
Compensating Controls

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

EPSS Score
3.0%
Top 12% exploitable
Prevalence
Low
consumer D-Link DSL modem/router, aging niche product, limited enterprise footprint
Social Media
9
Sightings
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 3.0%
Patch available No
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

69
Low Medium High Critical
KEV: 0
EPSS: +3
CVSS: +46
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy