CVE-2021-40047

7.5 HIGH

📋 TL;DR

CVE-2021-40047 is a memory leak vulnerability in Huawei's Bastet module where memory isn't properly released after its effective lifetime. This vulnerability could allow attackers to degrade system performance or cause denial-of-service conditions. It affects Huawei devices running HarmonyOS and certain Android-based EMUI systems.

💻 Affected Systems

Products:
  • Huawei smartphones
  • Huawei tablets
Versions: HarmonyOS 2.0 versions before 2.0.0.230, EMUI 12.0.0 versions before specific security patches
Operating Systems: HarmonyOS, Android-based EMUI
Default Config Vulnerable: ⚠️ Yes
Notes: Affects devices with the Bastet module, which handles network connection management. Exact device models vary by region and carrier.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

System instability leading to device crashes, denial-of-service, or potential privilege escalation through memory exhaustion attacks.

🟠

Likely Case

Gradual performance degradation, increased memory consumption, and potential application crashes over time.

🟢

If Mitigated

Minimal impact with proper memory management controls and monitoring in place.

🌐 Internet-Facing: LOW - This vulnerability requires local access or malicious app installation.
🏢 Internal Only: MEDIUM - Could be exploited by malicious apps or users with physical access to devices.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires local access or malicious application installation. No public exploit code has been disclosed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: HarmonyOS 2.0.0.230 and later, EMUI security patches March 2022 and later

Vendor Advisory: https://consumer.huawei.com/en/support/bulletin/2022/3/

Restart Required: Yes

Instructions:

1. Check for system updates in device Settings > System & updates > Software update. 2. Download and install available security updates. 3. Restart device after installation completes.

🔧 Temporary Workarounds

Disable unnecessary background services

all

Reduce memory pressure by limiting background processes

Regular device restarts

all

Clear accumulated memory leaks through periodic restarts

🧯 If You Can't Patch

  • Monitor device memory usage and performance metrics
  • Restrict installation of untrusted applications

🔍 How to Verify

Check if Vulnerable:

Check device OS version in Settings > About phone > HarmonyOS version or EMUI version

Check Version:

Settings > About phone > HarmonyOS version or EMUI version

Verify Fix Applied:

Verify OS version is HarmonyOS 2.0.0.230+ or check security patch date is March 2022 or later

📡 Detection & Monitoring

Log Indicators:

  • Abnormal memory consumption patterns
  • Bastet module crashes
  • Out of memory errors

Network Indicators:

  • Unusual network connection failures

SIEM Query:

Process memory usage > threshold AND process_name contains 'bastet'

🔗 References

📤 Share & Export