CVE-2024-47151
Executive Summary
CVE-2024-47151 is a file writing vulnerability affecting certain Honor products. Successful exploitation could allow an attacker to achieve arbitrary code execution on the target device. The vulnerability is currently unpatched, and no public proof-of-concept (PoC) or exploit code has been released. The EPSS score is 0.0%, indicating a very low probability of exploitation in the wild at this time. However, due to the potential for code execution, this vulnerability poses a significant risk to affected devices.
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 Honor devices.
CVSS Breakdown & Threat Level
CVSS Score: 6.3 (Medium) Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (Assumed)
- Attack Vector (AV): Local (AV:L) – The attacker requires local access to the device.
- Attack Complexity (AC): Low (AC:L) – No special conditions are required for exploitation.
- Privileges Required (PR): Low (PR:L) – The attacker needs low-level privileges.
- User Interaction (UI): None (UI:N) – No user action is required.
- Scope (S): Unchanged (S:U) – The vulnerability does not affect other components.
- Confidentiality (C): High (C:H) – Full data access possible.
- Integrity (I): High (I:H) – Full data modification possible.
- Availability (A): High (A:H) – Full system compromise possible.
Threat Level: Medium. While the CVSS score is moderate, the potential for code execution makes this a serious concern for affected devices.
Deep Dive & Mechanics
The vulnerability is a file writing flaw in Honor products. The exact mechanism is unknown, but it likely involves improper validation of file paths or content during a write operation. An attacker with local access could craft a malicious file that, when written to a specific location, overwrites critical system files or injects malicious code into a privileged process.
Potential Attack Vector:
- Local Access: The attacker gains local access to the device (e.g., via a malicious app, USB debugging, or physical access).
- File Write Exploitation: The attacker exploits the file writing vulnerability to write a malicious file to a sensitive location (e.g.,
/system/bin/,/data/local/tmp/). - Code Execution: The malicious file is executed, either by the system (e.g., a service restart) or by the attacker, leading to arbitrary code execution with the privileges of the target process.
Vulnerable vs. Patched Code
Since no patch is available, a direct code comparison is not possible. However, the vulnerability likely stems from a missing or insufficient check on file write operations.
Vulnerable Code (Hypothetical):
// Vulnerable: No path validation
void write_file(const char *user_path, const char *data) {
FILE *fp = fopen(user_path, "w");
if (fp) {
fputs(data, fp);
fclose(fp);
}
}
Patched Code (Hypothetical):
// Patched: Path validation and sanitization
void write_file(const char *user_path, const char *data) {
char safe_path[256];
if (!is_path_safe(user_path, safe_path, sizeof(safe_path))) {
return; // Reject unsafe path
}
FILE *fp = fopen(safe_path, "w");
if (fp) {
fputs(data, fp);
fclose(fp);
}
}
Exploitation & Lab Setup
Red Team (Offensive)
Objective: Achieve arbitrary code execution on a vulnerable Honor device.
Prerequisites:
- Local access to the device (e.g., via a malicious app or ADB).
- Knowledge of the vulnerable file write function.
Exploitation Steps:
- Identify Vulnerable Function: Reverse engineer the firmware to locate the file write function.
- Craft Payload: Create a malicious file (e.g., a shared library or script) that will be executed.
- Write Payload: Use the vulnerable function to write the payload to a location that will be executed (e.g.,
/data/local/tmp/exploit.so). - Trigger Execution: Trigger the execution of the payload (e.g., by loading the library via
LD_PRELOADor by restarting a service).
Example (Hypothetical):
# Assuming the vulnerable function is exposed via a service
adb shell "echo 'malicious_code' > /data/local/tmp/exploit.sh"
adb shell "chmod +x /data/local/tmp/exploit.sh"
adb shell "/data/local/tmp/exploit.sh"
Blue Team (Defensive)
Objective: Detect and prevent exploitation of CVE-2024-47151.
Detection:
- Monitor for unusual file write operations to sensitive directories.
- Use file integrity monitoring (FIM) to detect changes to critical system files.
- Implement application whitelisting to prevent execution of unauthorized binaries.
Prevention:
- Apply vendor patches as soon as they become available.
- Restrict local access to devices (e.g., disable USB debugging, use strong authentication).
- Use security solutions that can detect and block file-based attacks.
Indicators of Compromise (IOCs)
- File Hashes: Unknown (no public PoC).
- File Paths: Suspicious files written to
/data/local/tmp/,/system/bin/,/system/lib/, or other sensitive directories. - Process Behavior: Unusual processes spawning from unexpected locations (e.g.,
/data/local/tmp/exploit). - Network Connections: Outbound connections from the device to unknown IPs (post-exploitation).
Detection Engineering
YARA Rule
rule CVE_2024_47151_Honor_File_Write {
meta:
description = "Detects potential exploitation of CVE-2024-47151 via suspicious file writes"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-47151"
strings:
$suspicious_path = "/data/local/tmp/" nocase
$suspicious_ext = ".sh" nocase or ".so" nocase or ".elf" nocase
condition:
$suspicious_path and $suspicious_ext
}
Sigma Rule
title: Suspicious File Write to Sensitive Directory on Honor Device
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects file writes to sensitive directories that may indicate exploitation of CVE-2024-47151
author: Valters IT
date: 2025-04-10
logsource:
product: linux
category: file_event
detection:
selection:
TargetFilename|contains:
- '/data/local/tmp/'
- '/system/bin/'
- '/system/lib/'
TargetFilename|endswith:
- '.sh'
- '.so'
- '.elf'
condition: selection
falsepositives:
- Legitimate app installations
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-47151 Potential Post-Exploitation Outbound Connection"; flow:to_server; content:"|00 00 00 00|"; depth:4; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Monitor for Patches: Regularly check Honor's official website and security advisories for firmware updates.
- Restrict Local Access: Disable USB debugging, ADB, and other local access methods when not needed.
- Use Security Software: Install and maintain security solutions that can detect file-based attacks.
Long-Term Fixes:
- Apply Vendor Patch: Once available, apply the firmware update immediately.
- Code Review: Honor should review file write functions for proper input validation and path sanitization.
- Principle of Least Privilege: Ensure that processes run with the minimum necessary privileges.
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.