Vulnerability record · CVE-2024-12987 · published 27 December 2024
CVE-2024-12987: DrayTek Vigor router web interface OS command injection
Draytek · Vigor300b Firmware
DrayTek Vigor2960 and Vigor300B firmware 1.5.1.4 contain an OS command injection flaw in the /cgi-bin/mainfunction.cgi/apmcfgupload endpoint of the web management interface, reached by manipulating the session argument. A public exploit exists and the issue is listed in CISA KEV, so unpatched devices are a live target.
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.
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:
Automated analysis
critical priorityThe flaw is unauthenticated remote command injection with a public exploit and CISA KEV listing, making exploitation likely and impact severe.
What it is
DrayTek Vigor2960 and Vigor300B firmware 1.5.1.4 contain an OS command injection flaw in the /cgi-bin/mainfunction.cgi/apmcfgupload endpoint of the web management interface, reached by manipulating the session argument. A public exploit exists and the issue is listed in CISA KEV, so unpatched devices are a live target.
Impact
An unauthenticated remote attacker can execute arbitrary operating system commands on the router, giving full control of the device and its network position.
Attack surface
Reachable over the network through the web management interface via the apmcfgupload endpoint; the CVSS 4.0 vector shows no privileges or user interaction required.
Exploitation
Listed in CISA KEV with a due date of 2025-06-05, EPSS 30-day probability is about 0.98 (99.9th percentile), and a public exploit reference is tagged Exploit, indicating active exploitation.
What to do
- Upgrade Vigor2960 and Vigor300B to firmware 1.5.1.5 or later per the vendor release notes.
- If patching is not possible, remove the management interface from internet exposure and restrict access to trusted management networks.
- Follow CISA BOD 22-01 guidance or discontinue use of the affected devices if mitigations are unavailable.
- Audit for unauthorized configuration changes or added accounts on affected routers before and after patching.
Detection
- Monitor web server and router logs for requests to /cgi-bin/mainfunction.cgi/apmcfgupload, especially with unusual session parameter values.
- Alert on shell metacharacters or command strings in HTTP request parameters to the management CGI.
- Watch for unexpected outbound connections or processes spawned by the router's web service.
- Review router configuration and account changes for signs of post-exploitation tampering.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Exploitation in the wild
CISA added CVE-2024-12987 to the Known Exploited Vulnerabilities catalog on 15 May 2025 as "DrayTek Vigor Routers OS Command Injection Vulnerability". 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. Federal deadline 5 June 2025.
Affected products
2 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
| Link | Tags |
|---|---|
| https://netsecfish.notion.site/Command-Injection-in-apmcfgupload-endpoint-for-DrayTek-Gateway-Devices-1676b683e67c8040b7 | ExploitThird Party Advisory |
| https://vuldb.com/?ctiid.289380 | Permissions RequiredVDB Entry |
| https://vuldb.com/?id.289380 | Third Party AdvisoryVDB Entry |
| https://vuldb.com/?submit.468795 | Third Party AdvisoryVDB Entry |
| https://fw.draytek.com.tw/Vigor2960/Firmware/v1.5.1.5/DrayTek_Vigor2960_V1.5.1.5_01release-note.pdf | Release Notes |
| https://fw.draytek.com.tw/Vigor300B/Firmware/v1.5.1.5/DrayTek_Vigor300B_V1.5.1.5_01release-note.pdf | Release Notes |
| https://fw.draytek.com.tw/Vigor3900/Firmware/v1.5.1.5/DrayTek_Vigor3900_V1.5.1.5_01release-note.pdf | Not Applicable |
| https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-12987 | US Government Resource |
Track CVE-2024-12987 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2024-12987), CISA KEV, FIRST EPSS (scores of 2026-09-25). This page is refreshed as NVD updates the record.