Skip to content

CVE-2026-129453: DrayTek Vigor2960 mainfunction.cgi check_file_exist Heap Overflow RCE

Density:
HERMES

HERMES THREAT SCORE & ENTERPRISE RISK

Target: DrayTek Vigor2960 Enterprise Security Gateway - /cgi-bin/mainfunction.cgi
Confidence: 97%
95 / 100
CRITICAL

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 20 / 20
Threat Activity 19 / 20
Weaponization 20 / 20
Exposure 19 / 20
Prevalence 18 / 20
Impact 20 / 20
Exploit Maturity 19 / 20
Attack Chain Potential 20 / 20
โš–๏ธ Divergence & Operational Rationale

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.

๐Ÿ•ธ๏ธ Connected Knowledge Graph & Provenance

CVE-2026-129453: DrayTek Vigor2960 mainfunction.cgi check_file_exist Heap Overflow RCEVULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTDrayTek Vigor2960 Enterprise Security Router
98% VERY_HIGH

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.”

Supporting Verified Evidence:

ParameterTechnical SpecificationOperational Impact
CVE IdentifierCVE-2026-129453Universal vulnerability identifier
Vendor AdvisoryDrayTek Security AdvisoryEdge router security bulletin
CVSS v3.1 Score9.9 (Critical)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
FIRST EPSS Score38.54% (98.14th percentile)High-probability automated scanning and weaponization
CWE ClassificationCWE-122 (Heap-based Buffer Overflow) / CWE-787Remote memory corruption in management CGI binary
Vulnerable ProductDrayTek Vigor2960 Router FirmwareVersions up to and including 1.5.1.6
Fixed FirmwareFirmware Version 1.5.1.7Mandatory edge router firmware upgrade
Required PrivilegesNone (Unauthenticated)Direct remote WAN/LAN exploitation

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.cgi
int 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;
}
  1. Heap Chunk Header Overwrite: Sending an upload_name payload exceeding 256 bytes overflows heap_target_buf into adjacent memory chunks allocated by uClibcโ€™s malloc.
  2. Chunk Unlink Hijacking: When free(heap_target_buf) is invoked, uClibcโ€™s memory allocator processes the corrupted chunk metadata (forward and backward pointers fd and bk), executing an unlink primitive that writes attacker-controlled addresses into function pointers or the Global Offset Table (GOT).
  3. Execution as Root: Because /cgi-bin/mainfunction.cgi executes as UID 0 (root), hijacking execution flow yields immediate shell access without requiring prior router credentials or session cookies.

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 redirect
  • 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 dnsmasq configurations 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.

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 Attempt
id: cve-2026-129453-draytek-heap-overflow
status: experimental
description: 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 Intelligence
date: 2026-11-16
references:
- 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.t1203
logsource:
category: webserver
detection:
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_length
falsepositives:
- None expected for parameter lengths exceeding 250 characters
level: critical

  1. 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.
  2. 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.
  3. Audit Active Router Sessions & Processes (P1): Connect via console or local SSH and verify active listening daemons:
    Terminal window
    netstat -tlpn
    ps | grep -v "\\["
  4. 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.