DrayTek Vigor2960 setSWMProfile Stack Buffer Overflow (CVE-2026-132139)
Detects exploitation attempts against a stack-based buffer overflow (CWE-121/CWE-119) in the setSWMProfile function of /cgi-bin/mainfunction.cgi on DrayTek Vigor2960 routers up to firmware 1.5.1.6. An authenticated attacker supplies an overlong filename argument to the setSWMProfile action, overflowing a fixed-size stack buffer. The write-up shows the overflow overwrites saved registers including pc and lr and crashes the CGI process, so code execution may be possible. The attack can be performed remotely. Detection focuses on HTTP POST/GET requests to mainfunction.cgi carrying a setSWMProfile action with abnormally long parameter values, repeated crashes or restarts of the web management process, and anomalous outbound connections from the device. CVSS 8.6. A public proof-of-concept exploit is available. Firmware 1.5.1.7 addresses the issue.
Vulnerability Intelligence
TheoreticalTimeline
- Disclosed
- November 18, 2026
References & Proof of Concept
- PoChttps://github.com/yikesoftware/DrayTek_Vigor2960_Security_Analysis/tree/main/cases/DRV2960-0021-authenticated-setswmprofile-filename-stack-overflow
- https://fw.draytek.com.tw/Vigor2960/Firmware/v1.5.1.7/Vigor2960_v1.5.1.7.zip
- https://vuldb.com/cve/CVE-2026-132139
- https://vuldb.com/submit/1044966
- https://vuldb.com/vuln/439439
- https://vuldb.com/vuln/439439/cti
CVSS
What is CVE-2026-132139 DrayTek Vigor2960 setSWMProfile Stack Buffer Overflow (CVE-2026-132139)?
DrayTek Vigor2960 setSWMProfile Stack Buffer Overflow (CVE-2026-132139) (CVE-2026-132139) 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 setSWMProfile Stack Buffer Overflow (CVE-2026-132139), covering the data sources and telemetry it touches: Network Firewall/WAF logs (CEF), DrayTek syslog, Web proxy. The queries below are rated critical 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
// df00tech DF00-f703e50db8 · https://df00tech.com/detections/CVE-2026-132139 · licence: https://df00tech.com/detections/licence
let longThreshold = 512;
let suspectUA = dynamic(["curl","python-requests","python-urllib","Go-http-client","libwww-perl"]);
CommonSecurityLog
| where DeviceVendor has "DrayTek" or DeviceProduct has "Vigor" or RequestURL has "mainfunction.cgi"
| where RequestURL has "/cgi-bin/mainfunction.cgi"
| extend reqBody = coalesce(column_ifexists("RequestContext",""), AdditionalExtensions)
| where RequestURL has "setSWMProfile" or reqBody has "setSWMProfile"
| extend bodyLen = strlen(reqBody), urlLen = strlen(RequestURL)
| where bodyLen > longThreshold or urlLen > longThreshold or reqBody has "filename=" and strlen(extract(@"filename=([^&\s]+)", 1, reqBody)) > 256
| extend SuspectClient = iff(RequestClientApplication in~ (suspectUA), true, false)
| project TimeGenerated, SourceIP, DestinationIP, RequestURL, RequestMethod, bodyLen, urlLen, RequestClientApplication, SuspectClient, DeviceVendor, DeviceProduct
| sort by TimeGenerated desc Flags HTTP requests to DrayTek Vigor2960 mainfunction.cgi invoking the setSWMProfile action with oversized URL/body or an overlong filename parameter indicative of a stack overflow attempt.
Data Sources
Required Tables
False Positives
- Legitimate administrators saving large SWM (Switch Management) profiles with long but valid names
- Vulnerability scanners (Nessus, Qualys) probing mainfunction.cgi during authorized assessments
- Automation/backup tools posting large configuration payloads to the management CGI
Query fingerprint DF00-f703e50db8 · licence
Sigma logsource & community rules
The detection logic for DrayTek Vigor2960 setSWMProfile Stack Buffer Overflow (CVE-2026-132139) (CVE-2026-132139) 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:
Platform-specific guides for CVE-2026-132139
References (5)
- https://vuldb.com/cve/CVE-2026-132139
- https://vuldb.com/vuln/439439
- https://vuldb.com/vuln/439439/cti
- https://github.com/yikesoftware/DrayTek_Vigor2960_Security_Analysis/tree/main/cases/DRV2960-0021-authenticated-setswmprofile-filename-stack-overflow
- https://fw.draytek.com.tw/Vigor2960/Firmware/v1.5.1.7/Vigor2960_v1.5.1.7.zip
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 setSWMProfile filename POST (lab)
Expected signal: HTTP request log to mainfunction.cgi with setSWMProfile and a parameter >512 bytes; possible httpd crash/restart in device syslog.
- Test 2 Oversized setSWMProfile via GET query (lab)
Expected signal: HTTP GET log entry with URL length >512 bytes targeting mainfunction.cgi setSWMProfile.
- Test 3 Repeated setSWMProfile crash loop probe (lab)
Expected signal: Multiple oversized requests plus recurring httpd watchdog restarts/reboots in device syslog within a short window.
Response Playbook
Triage
- Confirm the target device is a DrayTek Vigor2960 running firmware 1.5.1.6 or earlier (vulnerable); firmware 1.5.1.7 contains the fix.
- Extract the full request to /cgi-bin/mainfunction.cgi and inspect the setSWMProfile action's filename/parameter length, values exceeding the buffer size (>256 bytes of filename or >512 bytes total) indicate an overflow attempt.
- Determine whether the request was authenticated (the flaw requires valid management credentials); correlate the source IP with known admin sessions and review preceding login events.
- Check the device management log/syslog for httpd or web-UI process crashes, watchdog restarts, or reboots occurring immediately after the suspect request.
Containment
- Block the attacking source IP at the perimeter and restrict management-interface (HTTP/HTTPS) access to a trusted administrative subnet or VPN only.
- Disable WAN-side access to the web management interface and, if compromise is suspected, isolate the device from the network pending forensic review.
- Rotate all administrative credentials for the affected device, since the vulnerability requires authentication and credentials may be compromised.
Evidence Collection
- Capture full packet/proxy logs of the malicious requests including headers, body, and the oversized setSWMProfile parameter for the overflow payload.
- Export the device configuration, syslog, and crash/reboot history before remediation to preserve evidence of exploitation and any attacker-made config changes.
- Preserve firewall, proxy, and NetFlow records showing connections to and any anomalous outbound connections from the device around the event window.
Escalation Criteria
- ! Escalate to incident response if device crashes/reboots coincide with the suspect request or if outbound connections from the device to unknown hosts appear (possible RCE/implant).
- ! Escalate if the attacking source correlates with an authenticated admin session from an unexpected geolocation or if configuration changes were made following the request.
Investigation Guide
Forensic Artifacts
- >
DrayTek web management (httpd) process crash dumps, watchdog restart entries and reboot timestamps in device syslog - >
HTTP access logs / proxy records containing the oversized setSWMProfile request to mainfunction.cgi - >
Device configuration diffs and any newly created SWM profiles following the suspect request
Tuning Guidance
Baseline the normal maximum length of legitimate setSWMProfile requests in your environment (valid profile names and payloads are typically well under 256 bytes) and adjust the length thresholds to just above that baseline. Whitelist authorized administrator source IPs and approved vulnerability-scanner ranges to reduce noise. If the device is not WAN-exposed, scope the detection to internal management subnets to focus on insider/lateral-movement scenarios.
Hunting Queries
Surfaces hosts sending unusually large setSWMProfile requests to DrayTek management CGI across the environment.
// df00tech DF00-f703e50db8 · https://df00tech.com/detections/CVE-2026-132139 · licence: https://df00tech.com/detections/licence
CommonSecurityLog | where RequestURL has "mainfunction.cgi" and (AdditionalExtensions has "setSWMProfile") | extend L=strlen(AdditionalExtensions) | summarize max(L), count() by SourceIP, DestinationIP | where max_L > 400 ``` df00tech DF00-f703e50db8 · https://df00tech.com/detections/CVE-2026-132139 · licence: https://df00tech.com/detections/licence ```
index=network uri_path="*mainfunction.cgi*" "setSWMProfile" | eval l=len(_raw) | stats max(l) as maxlen count by src_ip dest_ip | where maxlen>400 Atomic Red Team Tests
Sends an authenticated POST to mainfunction.cgi with an overlong filename argument to the setSWMProfile action, simulating the stack overflow trigger.
Command
curl -sk -b 'sessionid=LAB_SESSION' -X POST 'https://192.0.2.10/cgi-bin/mainfunction.cgi' --data "action=setSWMProfile&filename=$(python3 -c 'print("A"*800)')" Cleanup
echo 'No cleanup required; request is non-persistent. Reboot lab device if web UI became unresponsive.' Expected Telemetry
HTTP request log to mainfunction.cgi with setSWMProfile and a parameter >512 bytes; possible httpd crash/restart in device syslog.
Expected Detection
KQL/SPL oversized-request rules fire on the >512 byte setSWMProfile body.
Delivers the oversized setSWMProfile parameter via URL query string to test URL-length-based detection.
Command
curl -sk -b 'sessionid=LAB_SESSION' 'https://192.0.2.10/cgi-bin/mainfunction.cgi?action=setSWMProfile&filename='$(python3 -c 'print("B"*700)') Cleanup
echo 'No cleanup required; non-persistent request.' Expected Telemetry
HTTP GET log entry with URL length >512 bytes targeting mainfunction.cgi setSWMProfile.
Expected Detection
URL-length branch of the detection rules matches the oversized query string.
Issues multiple oversized setSWMProfile requests in succession to simulate repeated overflow attempts and resulting device crash/restart telemetry.
Command
for i in $(seq 1 5); do curl -sk -b 'sessionid=LAB_SESSION' -X POST 'https://192.0.2.10/cgi-bin/mainfunction.cgi' --data "action=setSWMProfile&filename=$(python3 -c 'print("C"*900)')"; sleep 2; done Cleanup
echo 'Reboot the lab device if the management interface remains unresponsive after the loop.' Expected Telemetry
Multiple oversized requests plus recurring httpd watchdog restarts/reboots in device syslog within a short window.
Expected Detection
Aggregation/stats rules flag repeated oversized setSWMProfile requests to the same device.
Related Detections
Tactic Hubs
Related Techniques
Same Tactic: Initial Access
Browse by tactic
- Reconnaissance TA0043
- Resource Development TA0042
- Initial Access TA0001
- Execution TA0002
- Persistence TA0003
- Privilege Escalation TA0004
- Stealth TA0005
- Defense Impairment TA0112
- Credential Access TA0006
- Discovery TA0007
- Lateral Movement TA0008
- Collection TA0009
- Command and Control TA0011
- Exfiltration TA0010
- Impact TA0040