Summary
CVE-2026-138288 is an OS command injection vulnerability (CWE-78) in the D-Link DSL-2640B router, firmware 3.0.6.0.41. The flaw is in the cgiWanCfg function of /wancfg.cmd. It is rated critical (CVSS 10.0), and a public exploit is available.
Technical details
- Root cause: The
ifnameargument of/wancfg.cmd(functioncgiWanCfg) is inserted without validation into a shell command (echo %d > /proc/var/fyi/wan/%s/wanup) that is run through/bin/sh -c. - Trigger conditions: A single crafted HTTP request to
/wancfg.cmdwith a maliciousifnamevalue. According to the public write-up, no WAN configuration or interface state is required. The effective payload is limited to about 15 bytes and should end with#. - Authentication: The public write-up states the endpoint nominally requires administrative credentials. It also reports a hardcoded account in the firmware, which makes exploitation possible without legitimate credentials. This detail comes from the researcher’s write-up, not from the CVE record.
- Attack vector: Network. The CVE record states the attack can be launched remotely and that the exploit has been disclosed publicly.
- Impact: Arbitrary command execution on the device. The public write-up reports execution as root.
Affected software
- D-Link DSL-2640B, firmware 3.0.6.0.41 (the write-up tests hardware revision A).
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/E:P/RL:X/RC:C
Mitigation and recommended actions
- Immediate: No vendor patch or advisory was identified in the sources reviewed. Check D-Link’s support channels for updates or end-of-life status for this model.
- Do not expose the device’s web management interface to the internet. Restrict access to trusted internal networks only.
- Block external access to
/wancfg.cmdand to the management interface at the perimeter. - Where the device cannot be secured, replace it with a supported model.
- Monitor for unexpected requests to
/wancfg.cmdwith shell metacharacters (such as;and#) inifname.

