The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-12987

CVE-2024-12987: Draytek Vigor300b Firmware RCE Flaw

CVE-2024-12987 is a critical remote code execution vulnerability in Draytek Vigor300b Firmware that enables OS command injection via the Web Management Interface. This article covers technical details, affected versions, and steps.

Published: April 1, 2026

CVE-2024-12987 Overview

A critical OS command injection vulnerability was discovered in DrayTek Vigor2960 and Vigor300B network gateway devices running firmware version 1.5.1.4. The vulnerability exists in the Web Management Interface, specifically within the /cgi-bin/mainfunction.cgi/apmcfgupload endpoint. Improper handling of the session argument allows remote attackers to inject and execute arbitrary operating system commands on the affected device without authentication.

Critical Impact

This vulnerability has been added to the CISA Known Exploited Vulnerabilities (KEV) catalog, indicating active exploitation in the wild. Remote attackers can achieve full system compromise on affected DrayTek gateway devices, potentially gaining persistent access to network infrastructure.

Affected Products

  • DrayTek Vigor2960 Firmware version 1.5.1.4
  • DrayTek Vigor300B Firmware version 1.5.1.4
  • DrayTek Vigor2960 Hardware
  • DrayTek Vigor300B Hardware

Discovery Timeline

  • 2024-12-27 - CVE-2024-12987 published to NVD
  • 2025-10-30 - Last updated in NVD database

Technical Details for CVE-2024-12987

Vulnerability Analysis

This vulnerability is classified as CWE-77: Command Injection, which occurs when an application constructs system commands using user-supplied input without proper sanitization. In the context of DrayTek gateway devices, the apmcfgupload CGI endpoint processes the session parameter in an unsafe manner, allowing attackers to inject shell metacharacters and arbitrary commands that are then executed with the privileges of the web server process.

Network gateway devices like the Vigor2960 and Vigor300B are high-value targets because they often sit at the perimeter of enterprise networks, making them ideal pivot points for further intrusion. The exploit has been publicly disclosed, significantly increasing the risk of widespread exploitation.

Root Cause

The root cause of this vulnerability lies in insufficient input validation and sanitization within the mainfunction.cgi script. When processing the session argument in the apmcfgupload function, the firmware fails to properly escape or validate user input before incorporating it into system command execution. This allows shell metacharacters such as semicolons, pipes, or backticks to break out of the intended command context and execute attacker-controlled commands.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can remotely target the Web Management Interface of vulnerable DrayTek devices by sending specially crafted HTTP requests to the /cgi-bin/mainfunction.cgi/apmcfgupload endpoint. By manipulating the session parameter with OS command injection payloads, attackers can execute arbitrary commands on the underlying Linux-based operating system.

The vulnerability allows attackers to perform actions such as downloading and executing malware, establishing reverse shells, modifying device configurations, intercepting network traffic, or using the compromised device as a launching point for attacks against internal network resources.

Detection Methods for CVE-2024-12987

Indicators of Compromise

  • Unexpected HTTP requests to /cgi-bin/mainfunction.cgi/apmcfgupload with suspicious characters in the session parameter (semicolons, pipes, backticks, $() patterns)
  • Unusual outbound connections from DrayTek devices to unknown IP addresses
  • Unexpected processes spawned by the web server or CGI handlers on the device
  • Modifications to device configuration files or firmware outside of normal administrative activities
  • Evidence of reverse shell connections or command-and-control beaconing originating from gateway devices

Detection Strategies

  • Implement network-based intrusion detection rules to identify HTTP requests containing command injection patterns targeting the apmcfgupload endpoint
  • Deploy web application firewall (WAF) rules to filter requests with shell metacharacters in CGI parameters
  • Monitor and alert on firmware version discrepancies across DrayTek device fleet using asset management tools
  • Review web server access logs on DrayTek devices for anomalous request patterns to CGI endpoints

Monitoring Recommendations

  • Enable detailed logging on DrayTek devices and forward logs to a centralized SIEM for correlation and analysis
  • Establish baseline network behavior for gateway devices and alert on deviations such as unexpected outbound connections
  • Conduct regular vulnerability scans of network infrastructure devices to identify unpatched firmware
  • Monitor CISA KEV catalog updates and threat intelligence feeds for indicators related to DrayTek exploitation campaigns

How to Mitigate CVE-2024-12987

Immediate Actions Required

  • Upgrade all affected DrayTek Vigor2960 and Vigor300B devices to firmware version 1.5.1.5 or later immediately
  • Restrict access to the Web Management Interface to trusted IP addresses only using firewall rules or device ACLs
  • Disable remote management access from the internet if not strictly required
  • Conduct forensic review of potentially compromised devices to identify signs of exploitation before patching
  • Isolate suspected compromised devices from the network pending investigation

Patch Information

DrayTek has released firmware version 1.5.1.5 which addresses this command injection vulnerability. Organizations should download and apply the patched firmware from official DrayTek resources:

  • DrayTek Vigor2960 Release Notes - Contains details on security fixes for the Vigor2960 platform
  • DrayTek Vigor300B Release Notes - Contains details on security fixes for the Vigor300B platform

Additional technical analysis is available from the NetSecFish Command Injection Analysis and the CISA Known Exploited Vulnerability entry for CVE-2024-12987.

Workarounds

  • Implement IP-based access control lists (ACLs) to restrict Web Management Interface access to authorized management networks only
  • Place DrayTek devices behind an additional firewall or VPN gateway that requires authentication before accessing the management interface
  • Disable the Web Management Interface entirely if command-line or console-based management is acceptable for your environment
  • Deploy network segmentation to limit lateral movement potential if a gateway device is compromised
bash
# Example: Restrict management access via firewall rules
# Block external access to DrayTek management interface (port 443/80)
iptables -A INPUT -p tcp --dport 443 -s ! 10.0.0.0/8 -j DROP
iptables -A INPUT -p tcp --dport 80 -s ! 10.0.0.0/8 -j DROP

# Allow only specific management subnet
iptables -A INPUT -p tcp --dport 443 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -s 192.168.1.0/24 -j ACCEPT

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechDraytek

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability79.52%

  • Known ExploitedNo
  • CVSS Vector
  • 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:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CISA KEV Information
  • In CISA KEVYes
  • CWE References
  • CWE-77
  • Technical References
  • NetSecFish Command Injection Analysis

  • VulDB #289380 (CTIID)

  • VulDB #289380

  • VulDB #468795 Submission

  • DrayTek Vigor2960 Release Notes

  • DrayTek Vigor300B Release Notes

  • DrayTek Vigor3900 Release Notes

  • CISA Known Exploited Vulnerability CVE-2024-12987
  • Related CVEs
  • CVE-2026-3040: Draytek Vigor300b Firmware RCE Vulnerability

  • CVE-2020-8515: Draytek Vigor2960 Firmware RCE Vulnerability

  • CVE-2020-15415: DrayTek Vigor Firmware RCE Vulnerability

  • CVE-2024-12986: Draytek Vigor300b Firmware RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English