Skip to content
CVE-2026-132141

DrayTek Vigor2960 mainfunction.cgi json_load_lock Stack Buffer Overflow (CVE-2026-132141)

Initial Access Execution Last updated:

Detects exploitation attempts against a stack-based buffer overflow (CWE-121/CWE-119) in the json_load_lock function reachable via the jsonstatus/useFile handling of /cgi-bin/mainfunction.cgi on DrayTek Vigor2960 routers running firmware up to 1.5.1.6. The overflow is triggered by an oversized useFile parameter supplied to mainfunction.cgi. The write-up states an authenticated administrator session is required. Stack corruption can crash the request CGI and may allow further code execution. This detection looks for HTTP requests to mainfunction.cgi with abnormally long parameter values and jsonstatus/useFile markers in firewall, proxy, WAF and network logs. CVSS 8.6. Exploit status: public (a proof-of-concept is published in the referenced write-up). Patched in firmware v1.5.1.7.

Based on yikesoftware DrayTek Vigor2960 Security Analysis, DRV2960-0023 authenticated jsonstatus useFile stack overflow

Vulnerability Intelligence

Theoretical

What is CVE-2026-132141 DrayTek Vigor2960 mainfunction.cgi json_load_lock Stack Buffer Overflow (CVE-2026-132141)?

DrayTek Vigor2960 mainfunction.cgi json_load_lock Stack Buffer Overflow (CVE-2026-132141) (CVE-2026-132141) maps to the Initial Access and Execution tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for DrayTek Vigor2960 mainfunction.cgi json_load_lock Stack Buffer Overflow (CVE-2026-132141), covering the data sources and telemetry it touches: Firewall, Web Proxy, WAF, Network IDS. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Execution
Microsoft Sentinel / Defender
kusto
// df00tech DF00-a0eb31161d · https://df00tech.com/detections/CVE-2026-132141 · licence: https://df00tech.com/detections/licence
// DrayTek Vigor2960 mainfunction.cgi json_load_lock overflow (CVE-2026-132141)
let overflowThreshold = 2000;
CommonSecurityLog
| where DeviceVendor in~ ("DrayTek", "Zscaler", "Fortinet", "Palo Alto Networks") or isnotempty(RequestURL)
| where RequestURL has "/cgi-bin/mainfunction.cgi"
| extend ReqBody = coalesce(column_ifexists("RequestContext", ""), AdditionalExtensions)
| where RequestURL has_any ("jsonstatus", "useFile", "json_load", "useFile=") or ReqBody has_any ("jsonstatus", "useFile", "json_load")
| extend ParamLen = strlen(RequestURL) + strlen(tostring(ReqBody))
| where ParamLen > overflowThreshold or RequestURL matches regex @"(?i)useFile=[^&\s]{512,}" or ReqBody matches regex @"(?i)useFile=[^&\s]{512,}"
| project TimeGenerated, SourceIP, DestinationIP, DestinationPort, RequestMethod, RequestURL, ParamLen, DeviceVendor, DeviceProduct
| sort by TimeGenerated desc

Flags HTTP requests to /cgi-bin/mainfunction.cgi referencing the jsonstatus/useFile handlers with oversized parameter content consistent with the json_load_lock stack overflow, as seen in firewall/proxy/WAF logs forwarded to Sentinel via CommonSecurityLog.

high severity medium confidence

Data Sources

Firewall Web Proxy WAF Network IDS

Required Tables

CommonSecurityLog

False Positives

  • Legitimate administrative polling of the Vigor2960 status JSON endpoints with large but benign payloads
  • Vulnerability scanners and authorized penetration testing tools probing mainfunction.cgi
  • Security appliances that normalize or pad URLs, inflating measured parameter length

Query fingerprint DF00-a0eb31161d · licence

Sigma logsource & community rules

The detection logic for DrayTek Vigor2960 mainfunction.cgi json_load_lock Stack Buffer Overflow (CVE-2026-132141) (CVE-2026-132141) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: network_connection
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Oversized useFile parameter to mainfunction.cgi

    Expected signal: Firewall/proxy log entry for a request to /cgi-bin/mainfunction.cgi with a multi-kilobyte URL and useFile parameter.

  2. Test 2 jsonstatus json_load_lock fuzz pattern

    Expected signal: Proxy/WAF log showing a POST to mainfunction.cgi with an oversized useFile body parameter.

  3. Test 3 Non-printable overflow payload

    Expected signal: Network log with a long, high-entropy useFile parameter directed at mainfunction.cgi.


Response Playbook

Triage

  1. Confirm the target IP is a DrayTek Vigor2960 and identify its firmware version; versions up to 1.5.1.6 are vulnerable while v1.5.1.7 is patched.
  2. Extract the full request to /cgi-bin/mainfunction.cgi and measure the length and content of the jsonstatus/useFile parameters; genuine overflow attempts contain hundreds-to-thousands of bytes or non-printable data.
  3. Determine whether the request was authenticated (valid session cookie/token) since the write-up states the vulnerability requires authentication, and identify which admin account or credential was used.
  4. Check whether the router responded with an error, reset the connection, or rebooted shortly after the request, indicating a successful crash.

Containment

  1. Block the source IP at the perimeter and restrict management-plane access to mainfunction.cgi to trusted admin networks/VPN only.
  2. Upgrade affected Vigor2960 devices to firmware v1.5.1.7 or later and disable remote (WAN-side) administration until patched.
  3. Rotate all DrayTek administrator credentials, as the write-up describes the exploit path as authenticated and the credential may be compromised.

Evidence Collection

  1. Capture and preserve the full HTTP request/response pair, including headers, cookies and body, from firewall/proxy/WAF logs.
  2. Collect the router's syslog, crash logs and any core dumps around the event timestamp to establish whether json_load_lock faulted.
  3. Preserve authentication logs correlating the session token used in the request to a specific admin account and source.

Escalation Criteria

  • ! Escalate to incident response if the router rebooted, became unreachable, or shows signs of configuration tampering or new accounts after the request.
  • ! Escalate if the same source successfully authenticated and then issued oversized mainfunction.cgi requests, indicating an active compromise rather than scanning.
  • ! Escalate if outbound connections, DNS changes, or firmware modification are observed on the device following the suspected exploitation.

Investigation Guide

Forensic Artifacts

  • > Router syslog/crash logs showing a fault in the json_load_lock/CGI handler
  • > Firewall/proxy access logs containing oversized jsonstatus/useFile requests to mainfunction.cgi
  • > Device NVRAM/config diffs showing unexpected changes after the event

Tuning Guidance

Baseline the normal length and content of legitimate jsonstatus/useFile requests from your management stations and raise the overflow length threshold above that baseline to cut noise. Whitelist authorized scanner and admin source IPs. If management traffic is only internal, restrict the detection to WAN-sourced requests to focus on untrusted exploitation attempts.


Hunting Queries

Surfaces source IPs sending unusually long requests to mainfunction.cgi over time, highlighting probing or fuzzing against the json_load_lock handler.

Hunting — KQL
kql
// df00tech DF00-a0eb31161d · https://df00tech.com/detections/CVE-2026-132141 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has "/cgi-bin/mainfunction.cgi" | extend L = strlen(RequestURL) | summarize max(L), count() by SourceIP, bin(TimeGenerated, 1h) | where max_L > 1500
Hunting — SPL
spl
``` df00tech DF00-a0eb31161d · https://df00tech.com/detections/CVE-2026-132141 · licence: https://df00tech.com/detections/licence ```
index=proxy OR index=firewall url="*/cgi-bin/mainfunction.cgi*" | eval L=len(url) | stats max(L) as maxlen count by src_ip | where maxlen>1500

Atomic Red Team Tests

Test 1 Oversized useFile parameter to mainfunction.cgi
linux

Sends an authenticated-style request with an extremely long useFile parameter to simulate the json_load_lock stack overflow trigger against a lab Vigor2960.

Command

bash
curl -sk "https://192.0.2.10/cgi-bin/mainfunction.cgi?action=jsonstatus&useFile=$(python3 -c 'print("A"*4096)')" -b "session=LABTOKEN" -o /dev/null -w '%{http_code}\n'

Cleanup

bash
echo 'No persistent artifacts; power-cycle the lab router if it crashed.'

Expected Telemetry

Firewall/proxy log entry for a request to /cgi-bin/mainfunction.cgi with a multi-kilobyte URL and useFile parameter.

Expected Detection

KQL/SPL rules fire on ParamLen exceeding the overflow threshold with jsonstatus/useFile markers.

Test 2 jsonstatus json_load_lock fuzz pattern
linux

Issues a POST with a json_load-style body containing a long payload to exercise the vulnerable code path.

Command

bash
curl -sk -X POST "https://192.0.2.10/cgi-bin/mainfunction.cgi" -b "session=LABTOKEN" --data "action=jsonstatus&json_load=1&useFile=$(python3 -c 'print("B"*2048)')"

Cleanup

bash
echo 'No cleanup required beyond verifying the device recovered.'

Expected Telemetry

Proxy/WAF log showing a POST to mainfunction.cgi with an oversized useFile body parameter.

Expected Detection

SPL/Elastic/Chronicle rules match on the long useFile value in the request body or query.

Test 3 Non-printable overflow payload
macos

Sends a useFile value containing non-ASCII bytes to mimic a shellcode-bearing overflow attempt.

Command

bash
python3 -c "import urllib.request,urllib.parse; p=urllib.parse.quote(b'\x90'*1024+b'\xcc'*512); urllib.request.urlopen('https://192.0.2.10/cgi-bin/mainfunction.cgi?action=jsonstatus&useFile='+p)"

Cleanup

bash
echo 'Reboot lab router if unresponsive.'

Expected Telemetry

Network log with a long, high-entropy useFile parameter directed at mainfunction.cgi.

Expected Detection

Length- and regex-based rules flag the oversized high-entropy useFile parameter.

Related Detections

Browse by tactic

Full ATT&CK matrix Search all detections