CVE-2024-12987 — Vigor300b Firmware
HIGHCVE-2024-12987 is a high-severity (CVSS 7.3) CWE-77 vulnerability in draytek vigor300b firmware. It is in CISA's Known Exploited Vulnerabilities catalog (added 2025-05-15) — treat it as actively exploited and patch now. No vendor fix is recorded yet; mitigation options are listed below.
A vulnerability, which was classified as critical, was found in DrayTek Vigor2960 and Vigor300B 1.5.1.4. Affected is an unknown function of the file /cgi-bin/mainfunction.cgi/apmcfgupload…
Exploitation Status
Actively exploited in the wild
- Confirmed by CISA's Known Exploited Vulnerabilities catalog on 2025-05-15. Federal agencies were required to remediate by 2025-06-05.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA (KEV catalog and SSVC triage) for CVE-2024-12987.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2024-12987 by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the ≥ 90% band (highlighted). Counts from FIRST.org, log-scaled.
Description
A vulnerability, which was classified as critical, was found in DrayTek Vigor2960 and Vigor300B 1.5.1.4. Affected is an unknown function of the file /cgi-bin/mainfunction.cgi/apmcfgupload of the component Web Management Interface. The manipulation of the argument session leads to os command injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 1.5.1.5 is able to address this issue. It is recommended to upgrade the affected component.
Affected Products
vigor300b firmwaredraytekvigor2960 firmwaredraytekDetection & mitigation playbook
Vendor / applianceDetect
Inventory every draytek vigor300b firmware deployment and check each version against the affected-products list above.
Remediation status
No patch has shipped for CVE-2024-12987 yet — track the draytek vigor300b firmware advisory for a fixed release and apply the workarounds below in the meantime.
Mitigate without a patch
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does. Alongside that, restrict the management interface to trusted networks and apply the vendor's recommended configuration mitigations.
How to detect CVE-2024-12987
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2024-12987 -u https://target- Template
- DrayTek Vigor - Command Injection
- Severity
- critical
- Impact
- Unauthenticated attackers can inject arbitrary system commands through the session parameter in the apmcfgupload endpoint to execute commands on DrayTek routers, enabling complete device compromise and network infiltration.
- Remediation
- Update the firmware to the latest version provided by DrayTek. If no update is available, consider implementing network segmentation to restrict access to the device's management interface.
Template by ProjectDiscovery nuclei-templates (ritikchaddha), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is CVE-2024-12987 being exploited in your environment?
Detect and block the exploit chain at execution, on systems you cannot patch yet.