Summary
CVE-2026-138287 is a critical OS command injection vulnerability (CWE-78 / CWE-77) in the D-Link DSL-2640B, version 3.0.6.0.41. It allows a remote attacker to execute commands without authentication. The CVSS score is 10.0 (Critical), and exploit code has been published.
Technical details
- Root cause: the
cgiPortMapQrySwitchfunction inportmapcfg.cmddoes not safely handle thepmapCfgNameargument. Manipulating it leads to OS command injection. - Trigger conditions: the attacker sends a crafted request with a malicious
pmapCfgNamevalue. The CVE record lists no privileges and no user interaction as required. - Attack vector: network (remote).
- Impact: command execution on the device, with high impact to confidentiality, integrity and availability. The scope is changed (S:C).
- A public proof of concept is referenced in the CVE record.
Affected software
- D-Link DSL-2640B firmware version 3.0.6.0.41
Severity
- CVSS v3.1 base score: 10.0 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: the CVE record contains no vendor patch or fixed version. Check the D-Link support site for advisories or firmware updates for the DSL-2640B.
- If no patch is available: restrict access to the device’s web management interface so it is not reachable from the internet or untrusted networks, and permit only trusted management hosts. Consider replacing the device if the vendor provides no fix.

