Summary
In D-Link DSL-2640B firmware 3.0.6.0.41, the cgiPortMapQrySwitch function in portmapcfg.cmd (Endpoint component) does not properly validate the pmapCfgName argument. This allows OS command injection (CWE-78/CWE-77).
According to the CVSS vector (10.0, critical), the attack is carried out over the network with low complexity and requires no authentication or user interaction. The scope is changed (S:C), meaning the impact extends beyond the vulnerable component itself. A successful attacker can execute commands on the device, fully compromising confidentiality, integrity and availability.
A public exploit has been published. The vulnerability is not listed in the CISA KEV catalog. Its EPSS score is about 3%, higher than roughly 88% of other vulnerabilities. No fixed version is listed.
Who is affected
Organizations and users running D-Link DSL-2640B routers on firmware 3.0.6.0.41, especially where the web interface is reachable from untrusted networks.
What to do
- Check D-Link's official advisories (https://www.dlink.com/) for fixed firmware or the support status of the DSL-2640B. If a patch is available, apply it immediately.
- Inventory your DSL-2640B devices and identify those running firmware 3.0.6.0.41.
- Disable access to the management web interface from the internet (WAN) and restrict it to trusted addresses.
- If no patch is available, consider replacing the device with a supported model.
- Monitor device logs and network traffic for signs of unauthorized access or unusual requests to portmapcfg.cmd.
Affected products and versions
CVSS vector, explained
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P/RL:X/RC:C
- Attack vector
- Network (from the internet)
- Attack complexity
- Low
- Privileges required
- None (no login)
- User interaction
- Not required
- Scope
- Affects other components
- Confidentiality
- High impact
- Integrity
- High impact
- Availability
- High impact
Weakness type (CWE)
References
- vuldb.com/vuln/445112
- vuldb.com/vuln/445112/cti
- vuldb.com/cve/CVE-2026-138287
- vuldb.com/submit/1074577
- github.com/dujiaode/DSL2640B/tree/main/01-portmapcfg-pmapcfgname-cmd-injection
- www.dlink.com/
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.