← Vulnerability feed

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.

6.9 CVSS 4.0 Medium CISA KEV since 15 May 2025 EPSS 98% · top 0.1% CWE-77 · Command injectionCWE-78 · OS command injection
6.9CVSS 4.0 base score, v2 7.5
98%EPSS exploitation probability, 30 days
YesIn CISA KEV, fix deadline passed
2Affected product versions listed by NVD
8References, 1 tagged exploit
17 Jun 2026Last modified by NVD

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

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 16 September 2026. Confidence: high.

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

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.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

9.8CVE-2020-15415DrayTek Vigor routers OS command injection in cvmcfguploadDrayTek Vigor3900, Vigor2960 and Vigor300B devices before firmware 1.5.1 allow OS command injection through shell metacharacters in a filename upload…KEVEPSS 84%analysed9.8CVE-2020-8515DrayTek Vigor routers unauthenticated OS command injection in web managementDrayTek Vigor2960, Vigor3900 and Vigor300B firmware pass shell metacharacters to cgi-bin/mainfunction.cgi, allowing OS command injection. Because the…KEVEPSS 100%analysed9.8CVE-2021-42911Draytek vigor2960 firmware vulnerabilityA Format String vulnerability exists in DrayTek Vigor 2960 <= 1.5.1.3, DrayTek Vigor 3900 <= 1.5.1.3, and DrayTek Vigor 300B <= 1.5.1.3 in the mainfu…EPSS 3.5%9.8CVE-2021-43118Draytek vigor2960 firmware command injection vulnerabilityA Remote Command Injection vulnerability exists in DrayTek Vigor 2960 1.5.1.3, DrayTek Vigor 3900 1.5.1.3, and DrayTek Vigor 300B 1.5.1.3 via a craft…EPSS 35%9.8CVE-2020-14473Draytek vigor300b firmware out-of-bounds write vulnerabilityStack-based buffer overflow vulnerability in Vigor3900, Vigor2960, and Vigor300B with firmware before 1.5.1.1.EPSS 2.3%9.8CVE-2020-14472Draytek vigor300b firmware command injection vulnerabilityOn Draytek Vigor3900, Vigor2960, and Vigor 300B devices before 1.5.1.1, there are some command-injection vulnerabilities in the mainfunction.cgi file.EPSS 2.9%9.8CVE-2020-14993Draytek vigor300b firmware out-of-bounds write vulnerabilityA stack-based buffer overflow on DrayTek Vigor2960, Vigor3900, and Vigor300B devices before 1.5.1.1 allows remote attackers to execute arbitrary code…EPSS 5.3%9.8CVE-2020-10823Draytek vigor300b firmware out-of-bounds write vulnerabilityA stack-based buffer overflow in /cgi-bin/activate.cgi through var parameter on Draytek Vigor3900, Vigor2960, and Vigor300B devices before 1.5.1 allo…EPSS 4.4%

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.