CVE DatabaseCVE-2024-12987
한국어 권고문 →
CVE-2024-129879.8/CRITICALCISA KEVCWE-77CWE-78

DrayTek Vigor2960 and Vigor300B Remote Command Injection Vulnerability Advisory (CVE-2024-12987)

⚡ Jump to Patch
Affected Vendors
draytek
Affected Components
vigor2960, vigor300b
Published Date
2024-12-27
CVSS v3.1
9.8
CRITICAL
EPSS (30d)
98.2%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

DrayTek Vigor2960 and Vigor300B gateway devices running firmware version 1.5.1.4 or prior

Impact

Unauthenticated remote attackers can execute arbitrary OS commands with root privileges via the Web Management Interface, leading to full system compromise

Mitigation

Immediately upgrade to firmware version 1.5.1.5 or higher and disable WAN-side web management access

Affected Products & Version Scope

DrayTek Vigor2960 and Vigor300B routers/gateways running firmware version 1.5.1.4 and below

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

It is highly recommended to upgrade the affected devices to firmware version 1.5.1.5 or later immediately. Use the following reference commands or perform the upgrade via the Web UI ('System Maintenance -> Firmware Upgrade').

bash
# 1. Verify the current firmware version of the device
sys version

# 2. Download and apply the secure firmware version (v1.5.1.5 or higher) from the official DrayTek repository
# (Manual upgrade via the Web GUI is recommended for stability)

2. Temporary Workaround & Hardening Configuration

If patching cannot be applied immediately, restrict access to the web management interface from the WAN side to mitigate remote exploitation attempts.

bash
# Disable HTTP/HTTPS management access from the WAN interface via CLI
sys config
no management wan http
no management wan https
save

# Restrict management access to trusted IP addresses only using Access Control Lists (ACLs)

3. Log Audit & IoC Verification Commands

Inspect the web server access logs for suspicious requests targeting the vulnerable endpoint containing shell metacharacters.

bash
# Scan web server access logs for exploitation attempts targeting the apmcfgupload endpoint
grep -Ei 'apmcfgupload' /var/log/httpd/access_log | grep -E 'session=.*[%3b|%26|%60|\;|\&|\`]'

# Check for unexpected active shell processes running on the gateway
ps | grep -E 'sh|bash|ash' | grep -v 'grep'
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
NordLayer / Zero-Trust Network Access
Due to active exploitation in the wild, immediately upgrade all exposed DrayTek Vigor2960/300B devices to firmware v1.5.1.5 or higher.

Stop Exposing VPN Ports to the Internet — Switch to Zero-Trust Access

Eliminate public-facing VPN concentrators and firewall management ports with identity-first Zero-Trust Network Access.

90% Attack Surface Reduction · Hardware-Free

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

A critical OS command injection vulnerability (CVE-2024-12987) has been identified in the Web Management Interface of DrayTek Vigor2960 and Vigor300B gateway devices. The root cause lies within the /cgi-bin/mainfunction.cgi/apmcfgupload endpoint, which fails to properly sanitize and validate user-supplied input passed via the session parameter. Consequently, shell metacharacters injected into this parameter are executed directly by the underlying operating system shell.

2. Exploitation Mechanics & Attack Scenario

This vulnerability can be exploited remotely without any prior authentication. An attacker can execute the following steps to compromise a target device:

  • Locate an internet-exposed DrayTek Vigor2960 or Vigor300B web management interface.
  • Craft a malicious HTTP POST request targeting /cgi-bin/mainfunction.cgi/apmcfgupload.
  • Inject arbitrary shell commands into the session parameter using command separators such as semicolons (;), backticks (` `), or pipes (|`).
  • Upon receiving the request, the vulnerable CGI binary executes the payload with root privileges, allowing the attacker to establish a reverse shell or download malicious binaries.

3. Infrastructure & Business Impact

With a CVSS score of 9.8 (Critical) and its inclusion in the CISA KEV (Known Exploited Vulnerabilities) catalog, this vulnerability poses an immediate threat to enterprise networks. Successful exploitation allows complete control over the perimeter gateway. Attackers can leverage this foothold to perform lateral movement within the internal network, intercept sensitive network traffic, harvest VPN credentials, or enlist the compromised device into a botnet for DDoS campaigns.

Official Vendor Advisories & References

NVD Original English 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.

Frequently Asked SecOps Questions (CVE-2024-12987)

FAQ

Q1. How critical is CVE-2024-12987 and is it actively exploited in the wild?

CVE-2024-12987 is rated CVSS 9.8 (CRITICAL) with a 30-day EPSS exploitation probability of 98.2%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2024-12987?

Primary impacted vendors include draytek across vigor2960, vigor300b. Scope summary: DrayTek Vigor2960 and Vigor300B routers/gateways running firmware version 1.5.1.4 and below

Q3. What temporary mitigations or workarounds exist for CVE-2024-12987 before patching?

[Mitigation] Immediately upgrade to firmware version 1.5.1.5 or higher and disable WAN-side web management access Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2024-12987

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (draytek)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2024-12987 DrayTek Vigor2960 and Vigor300B Remote Command Injection Vulnerability Advisory (CVE-2024-12987) (CVSS 9.8) - Patch & Workaround | CVE Pulse