Detect DrayTek Vigor2960 mainfunction.cgi json_load_lock Stack Buffer Overflow (CVE-2026-132141) in CrowdStrike LogScale
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.
MITRE ATT&CK
- Tactic
- Initial Access Execution
LogScale Detection Query
// df00tech DF00-a0eb31161d · https://df00tech.com/detections/CVE-2026-132141 · licence: https://df00tech.com/detections/licence
#event_simpleName=NetworkConnectIP4 OR #event_simpleName=HttpRequest
| HttpPath=/*cgi-bin/mainfunction.cgi*
| HttpQuery=/(?i)(jsonstatus|useFile|json_load)/
| length("HttpQuery") as param_len
| param_len > 512
| table([@timestamp, aid, RemoteAddressIP4, HttpPath, HttpQuery, param_len]) CrowdStrike CQL query surfacing HTTP requests to mainfunction.cgi with oversized jsonstatus/useFile query strings as seen from endpoint/network sensor telemetry.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate large status polling of the router
- Authorized scanning
- Instrumentation that lengthens captured query strings
Other platforms for CVE-2026-132141
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.
- 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.
- 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.
- Test 3 Non-printable overflow payload
Expected signal: Network log with a long, high-entropy useFile parameter directed at mainfunction.cgi.
References (5)
- https://fw.draytek.com.tw/Vigor2960/Firmware/v1.5.1.7/Vigor2960_v1.5.1.7.zip
- https://github.com/yikesoftware/DrayTek_Vigor2960_Security_Analysis/tree/main/cases/DRV2960-0023-authenticated-jsonstatus-usefile-stack-overflow
- https://vuldb.com/cve/CVE-2026-132141
- https://vuldb.com/vuln/439441
- https://vuldb.com/vuln/439441/cti
Response Playbook
Triage
- 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.
- 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.
- 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.
- Check whether the router responded with an error, reset the connection, or rebooted shortly after the request, indicating a successful crash.
Containment
- Block the source IP at the perimeter and restrict management-plane access to mainfunction.cgi to trusted admin networks/VPN only.
- Upgrade affected Vigor2960 devices to firmware v1.5.1.7 or later and disable remote (WAN-side) administration until patched.
- Rotate all DrayTek administrator credentials, as the write-up describes the exploit path as authenticated and the credential may be compromised.
Evidence Collection
- Capture and preserve the full HTTP request/response pair, including headers, cookies and body, from firewall/proxy/WAF logs.
- Collect the router's syslog, crash logs and any core dumps around the event timestamp to establish whether json_load_lock faulted.
- 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.
// 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 ``` 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
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
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
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.
Issues a POST with a json_load-style body containing a long payload to exercise the vulnerable code path.
Command
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
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.
Sends a useFile value containing non-ASCII bytes to mimic a shellcode-bearing overflow attempt.
Command
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
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.