CVE-2025-56007
Executive Summary
CVE-2025-56007 is a critical CRLF injection vulnerability in KeeneticOS, affecting versions prior to 4.3. The flaw resides in the /auth API endpoint, allowing an attacker to inject carriage return and line feed (CRLF) characters into HTTP headers. By tricking a victim into visiting a crafted URL, an attacker can perform HTTP response splitting, leading to the addition of a new administrative user with full permissions. This effectively grants the attacker complete control over the device. The vulnerability has a CVSS score of 6.5 (Medium), but the impact is severe due to the potential for full device takeover. A patch is available in KeeneticOS 4.3.
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 NPM, PyPI, Go, or Ruby packages. It is a firmware-level issue in KeeneticOS, affecting the embedded web server and authentication API.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack Vector (AV): Network – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): None – No authentication is needed to trigger the injection.
- User Interaction (UI): Required – The victim must click a crafted link or visit a malicious page.
- Scope (S): Unchanged – The exploit affects only the vulnerable component.
- Confidentiality (C): High – An attacker can gain full access to device data.
- Integrity (I): High – An attacker can modify device configuration and add users.
- Availability (A): High – An attacker could potentially disrupt device operation.
Threat Level: High. While the CVSS score is Medium, the real-world impact is severe due to the ability to achieve persistent, privileged access to the device.
Deep Dive & Mechanics
The vulnerability is a classic CRLF injection (CWE-93) in the /auth API endpoint of KeeneticOS. The endpoint is used for authentication and likely processes user-supplied input (e.g., username, password, or redirect parameters) without proper sanitization.
How it works:
- The
/authendpoint accepts HTTP requests with parameters that are reflected in the HTTP response headers. - An attacker crafts a malicious URL containing CRLF sequences (
%0d%0aor\r\n) followed by arbitrary HTTP headers and body content. - When the victim visits this URL, the server's response is split into two separate HTTP responses.
- The second response, controlled by the attacker, can set arbitrary cookies, redirect the browser, or, in this case, execute a script that adds a new administrative user to the device.
- The attacker can then log in with the newly created credentials and take full control of the Keenetic device.
Example Attack Flow:
- Attacker crafts a URL like:
http://<router-ip>/auth?redirect=%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0a%0d%0a<script>fetch('/auth',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'username=hacker&password=hacked&role=admin'})</script> - Victim clicks the link.
- The server interprets the CRLF and sends two responses. The browser processes the second response as a new page.
- The JavaScript in the second response executes, sending a POST request to
/authto create a new user. - The attacker now has admin access.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
# Vulnerable Python-like pseudocode
def handle_auth(request):
redirect_url = request.GET.get('redirect', '/')
response = HttpResponseRedirect(redirect_url)
return response
The redirect_url is directly used in the Location header without sanitization, allowing CRLF injection.
Patched Code (Conceptual):
# Patched Python-like pseudocode
import re
def handle_auth(request):
redirect_url = request.GET.get('redirect', '/')
# Sanitize: remove any CRLF characters
sanitized_url = re.sub(r'[\r\n]', '', redirect_url)
response = HttpResponseRedirect(sanitized_url)
return response
The patched code removes any CRLF characters from the input before using it in the response header.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A Keenetic device running KeeneticOS < 4.3.
- A victim machine (e.g., a browser on the same network).
- A web server to host the exploit page (optional, for social engineering).
Exploit Steps:
Craft the Malicious URL: Replace
<router-ip>with the target device's IP address.http://<router-ip>/auth?redirect=%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0a%0d%0a<script>fetch('/auth',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'username=attacker&password=attacker123&role=admin'})</script>Deliver the URL:
- Send the URL to the victim via email, messaging, or a phishing page.
- Alternatively, host a page that auto-redirects to the crafted URL.
Execute:
- The victim clicks the link.
- The browser processes the injected response and executes the JavaScript.
- A new user
attackerwith passwordattacker123and admin role is created.
Takeover:
- Log in to the Keenetic web interface using the new credentials.
- Change settings, exfiltrate data, or pivot to other devices on the network.
No Exploit-DB code was provided.
Blue Team (Defensive)
Detection:
- Monitor HTTP requests to
/authfor unusual parameters containing%0d%0aor\r\n. - Look for multiple
Set-CookieorLocationheaders in a single response. - Alert on the creation of new users, especially with admin privileges, outside of normal administrative activity.
Prevention:
- Apply the vendor patch immediately (upgrade to KeeneticOS 4.3).
- Implement a Web Application Firewall (WAF) rule to block CRLF sequences in request parameters.
- Restrict access to the Keenetic web interface to trusted IP addresses only.
- Educate users not to click on suspicious links, especially those containing IP addresses or unusual characters.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/authcontaining%0d%0aor\r\nin the query string. - HTTP responses from the Keenetic device with multiple
Set-CookieorLocationheaders. - Unusual POST requests to
/authwith parameters likeusername,password, androle.
- HTTP requests to
- Host IOCs (on the Keenetic device):
- New user accounts in the system configuration that were not created by an administrator.
- Unusual entries in the device logs indicating user creation or authentication from unknown IPs.
- File IOCs:
- Modified configuration files (e.g.,
/etc/config/usersor similar) containing unauthorized user entries.
- Modified configuration files (e.g.,
Detection Engineering
YARA Rule
rule CVE_2025_56007_CRLF_Injection {
meta:
description = "Detects CRLF injection attempts targeting KeeneticOS /auth endpoint"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-56007"
severity = "high"
strings:
$crlf1 = "%0d%0a"
$crlf2 = "%0D%0A"
$crlf3 = "\\r\\n"
$auth_path = "/auth"
$user_creation = "username="
$role_admin = "role=admin"
condition:
any of ($crlf*) and $auth_path and (all of ($user_creation, $role_admin))
}
Sigma Rule
title: KeeneticOS CRLF Injection Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests to KeeneticOS /auth endpoint containing CRLF sequences
author: Valters IT
date: 2025/04/10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-56007
logsource:
category: webserver
product: keenetic
detection:
selection:
cs-uri-query|contains:
- '%0d%0a'
- '%0D%0A'
- '\\r\\n'
cs-uri-stem: '/auth'
condition: selection
falsepositives:
- Legitimate use of encoded characters in other contexts (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-56007 KeeneticOS CRLF Injection Attempt";
flow:to_server,established;
content:"/auth"; http_uri;
content:"%0d%0a"; http_uri;
content:"username="; http_uri;
content:"role=admin"; http_uri;
classtype:attempted-admin;
sid:10000001;
rev:1;
reference:cve,2025-56007;
)
Remediation & Mitigation
Immediate Actions:
- Patch: Upgrade all Keenetic devices to KeeneticOS version 4.3 or later. This is the only complete fix.
- Workaround: If patching is not immediately possible, restrict access to the web interface to trusted IP addresses only using firewall rules.
- Monitor: Review device logs for any signs of unauthorized user creation or suspicious authentication attempts.
Long-Term Measures:
- Implement a Web Application Firewall (WAF) with rules to block CRLF injection attempts.
- Conduct regular security audits of all network devices.
- Ensure that all firmware and software are kept up-to-date.
- Educate users about the risks of clicking on unsolicited links.
Valters IT