CVE-2026-129453: DrayTek Vigor2960 mainfunction.cgi check_file_exist Heap Overflow RCE
HERMES THREAT SCORE & ENTERPRISE RISK
Target:DrayTek Vigor2960 Enterprise Security Gateway - /cgi-bin/mainfunction.cgi CVSS v3.1 rates CVE-2026-129453 at 9.9 Critical. Hermes Threat Score aligns at 95 (CRITICAL). As perimeter multi-WAN and IPsec VPN concentrators for enterprise branches, DrayTek Vigor2960 gateways sit unshielded on the public Internet. Unauthenticated heap memory corruption directly compromises the edge router root context, enabling eavesdropping on VPN tunnels, DNS hijacking, and immediate unauthorized lateral access into all internal subnets.
CVE-2026-129453: DrayTek Vigor2960 mainfunction.cgi check_file_exist Heap Overflow RCEVULNERABILITY
Software platform affected by security vulnerabilities and agentic attack patterns.
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in DrayTek Vigor2960 Enterprise Security Router documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
1. Technical Metadata & Affected Surface
Section titled โ1. Technical Metadata & Affected Surfaceโ| Parameter | Technical Specification | Operational Impact |
|---|---|---|
| CVE Identifier | CVE-2026-129453 | Universal vulnerability identifier |
| Vendor Advisory | DrayTek Security Advisory | Edge router security bulletin |
| CVSS v3.1 Score | 9.9 (Critical) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| FIRST EPSS Score | 38.54% (98.14th percentile) | High-probability automated scanning and weaponization |
| CWE Classification | CWE-122 (Heap-based Buffer Overflow) / CWE-787 | Remote memory corruption in management CGI binary |
| Vulnerable Product | DrayTek Vigor2960 Router Firmware | Versions up to and including 1.5.1.6 |
| Fixed Firmware | Firmware Version 1.5.1.7 | Mandatory edge router firmware upgrade |
| Required Privileges | None (Unauthenticated) | Direct remote WAN/LAN exploitation |
2. Root Cause Analysis & Heap Corruption Mechanism
Section titled โ2. Root Cause Analysis & Heap Corruption MechanismโThe DrayTek Vigor2960 web interface executes under a customized Linux environment using BusyBox and lighttpd. Incoming web requests for router management tasks are dispatched to /cgi-bin/mainfunction.cgi.
In firmware version 1.5.1.6, the check_file_exist function handles file verification for backup, firmware upgrade, and certificate upload operations:
// Decompiled representation of check_file_exist in /cgi-bin/mainfunction.cgiint check_file_exist(void) { char *upload_name = NULL; char *heap_target_buf = NULL; int len = 0;
// Extract user-controlled parameter from HTTP POST/GET query string upload_name = cgi_get_parameter("upload_name"); if (!upload_name) { cgi_send_response("{\"status\": \"error\", \"msg\": \"missing parameter\"}"); return -1; }
// Allocate fixed-size buffer on the heap (256 bytes) heap_target_buf = (char *)malloc(256); if (!heap_target_buf) { return -1; } memset(heap_target_buf, 0, 256);
// VULNERABILITY: No boundary check before copying into the 256-byte buffer! // strcpy copies untrusted upload_name until a null byte is encountered strcpy(heap_target_buf, upload_name);
// File existence check operation char path_buf[512]; snprintf(path_buf, sizeof(path_buf), "/tmp/upload/%s", heap_target_buf);
if (access(path_buf, F_OK) == 0) { cgi_send_response("{\"status\": \"success\", \"exists\": 1}"); } else { cgi_send_response("{\"status\": \"success\", \"exists\": 0}"); }
free(heap_target_buf); return 0;}Memory Corruption & Exploitation Mechanics
Section titled โMemory Corruption & Exploitation Mechanicsโ- Heap Chunk Header Overwrite: Sending an
upload_namepayload exceeding 256 bytes overflowsheap_target_bufinto adjacent memory chunks allocated by uClibcโsmalloc. - Chunk Unlink Hijacking: When
free(heap_target_buf)is invoked, uClibcโs memory allocator processes the corrupted chunk metadata (forward and backward pointersfdandbk), executing an unlink primitive that writes attacker-controlled addresses into function pointers or the Global Offset Table (GOT). - Execution as Root: Because
/cgi-bin/mainfunction.cgiexecutes as UID 0 (root), hijacking execution flow yields immediate shell access without requiring prior router credentials or session cookies.
3. Attack Vectors & Perimeter Kill Chain
Section titled โ3. Attack Vectors & Perimeter Kill ChainโsequenceDiagram autonumber actor Attacker as Remote Adversary (WAN / Internet) participant Router as DrayTek Vigor2960 (WAN:443) participant CGI as /cgi-bin/mainfunction.cgi participant Heap as uClibc Heap Memory participant Kernel as Linux OS (UID 0 root)
Attacker->>Router: POST /cgi-bin/mainfunction.cgi?action=check_file_exist Note over Attacker,Router: Body: upload_name=AAAA...[Heap Overflow Payload + ROP Chain] Router->>CGI: Dispatches request to check_file_exist() CGI->>Heap: malloc(256) and unconstrained strcpy(upload_name) Note over Heap: Overflows into adjacent chunk headers & GOT table CGI->>Heap: free(heap_target_buf) triggers allocator consolidation Heap-->>Kernel: Control flow diverted to system() / reverse shell Kernel-->>Attacker: Interactive root shell on router perimeter Note over Attacker,Kernel: Attacker establishes persistent VPN eavesdropping & DNS redirectOperational Consequences of Gateway Compromise
Section titled โOperational Consequences of Gateway Compromiseโ- VPN Traffic Interception: DrayTek Vigor2960 appliances terminate corporate site-to-site IPsec tunnels. Root compromise enables eavesdropping on unencrypted internal communications before encapsulation.
- DNS Hijacking & Credential Harvesting: Attackers rewrite local
dnsmasqconfigurations to redirect enterprise clients to adversary phishing portals. - Internal Network Pivot: The router serves as the gateway to internal subnets; attackers deploy SOCKS5 proxies or SSH tunnels to scan and exploit internal servers.
4. Forensic Triage & Detection Engineering
Section titled โ4. Forensic Triage & Detection EngineeringโSecurity teams should audit external HTTP requests to DrayTek routers and check management logs for abnormal process restarts or oversized URI arguments.
title: DrayTek Vigor2960 mainfunction.cgi Buffer Overflow Exploit Attemptid: cve-2026-129453-draytek-heap-overflowstatus: experimentaldescription: Detects HTTP requests targeting DrayTek Vigor2960 check_file_exist endpoint with abnormal upload_name parameter length indicating heap overflow exploitation.author: Hermes Codex Cyber Threat Intelligencedate: 2026-11-16references: - https://nvd.nist.gov/vuln/detail/CVE-2026-129453 - https://www.draytek.com/about/security-advisory/tags: - attack.initial_access - attack.t1190 - attack.execution - attack.t1203logsource: category: webserverdetection: selection_endpoint: cs-method: - 'POST' - 'GET' cs-uri-stem|contains: '/cgi-bin/mainfunction.cgi' selection_param: cs-uri-query|contains: 'action=check_file_exist' selection_payload: cs-uri-query|contains: 'upload_name=' filter_length: cs-uri-query|re: 'upload_name=[A-Za-z0-9%_-]{250,}' condition: selection_endpoint and selection_param and selection_payload and filter_lengthfalsepositives: - None expected for parameter lengths exceeding 250 characterslevel: critical// Azure Sentinel / WAF Logs / Suricata HTTP Events// Detects DrayTek Vigor2960 heap overflow exploitation attemptsW3CIISLog| where csUriStem has "/cgi-bin/mainfunction.cgi"| where csUriQuery has "check_file_exist" and csUriQuery has "upload_name="| extend UploadNameLen = strlen(extract("upload_name=([^&]+)", 1, csUriQuery))| where UploadNameLen > 250| project TimeGenerated, cIP, sIP, csMethod, csUriStem, csUriQuery, UploadNameLen, scStatus| order by TimeGenerated desc# Suricata Network Intrusion Detection Rulealert http any any -> $HOME_NET any ( msg:"HERMES CODEX - DrayTek Vigor2960 mainfunction.cgi Heap Overflow (CVE-2026-129453)"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/cgi-bin/mainfunction.cgi"; http.uri; content:"action=check_file_exist"; http.client_body; content:"upload_name="; pcre:"/upload_name=[^&\r\n]{250,}/"; classtype:attempted-admin; sid:2026129453; rev:1; reference:cve,2026-129453;)5. Remediation Strategy & Mitigation Plan
Section titled โ5. Remediation Strategy & Mitigation Planโ- Immediate Firmware Patch Application (P0): Upgrade all DrayTek Vigor2960 devices to firmware version 1.5.1.7 or later. The update implements rigorous length validation and bounded string copying (
strncpy/snprintf) inside/cgi-bin/mainfunction.cgi. - Disable Remote Management Access (P0): Restrict router management interfaces (
HTTP/HTTPS) to local LAN subnets or dedicated management VLANs. Under System Maintenance > Management, disable Allow Management from the Internet. - Audit Active Router Sessions & Processes (P1): Connect via console or local SSH and verify active listening daemons:
Terminal window netstat -tlpnps | grep -v "\\[" - Inspect DNS & VPN Configuration Integrity (P1): Ensure that primary and secondary DNS settings have not been modified to rogue resolver addresses, and verify that no unauthorized IPsec or SSL VPN user profiles have been provisioned.