CVE-2024-48931

7.5 HIGH

📋 TL;DR

This vulnerability allows authenticated users of ZimaOS to read arbitrary files on the system by manipulating the 'files' parameter in the API endpoint. Attackers can access sensitive files like /etc/shadow containing password hashes, potentially leading to privilege escalation. All ZimaOS users running version 1.2.4 or earlier are affected.

💻 Affected Systems

Products:
  • ZimaOS
Versions: 1.2.4 and all prior versions
Operating Systems: ZimaOS (fork of CasaOS)
Default Config Vulnerable: ⚠️ Yes
Notes: Affects both Zima devices and x86-64 systems with UEFI running ZimaOS. Requires authentication but any authenticated user can exploit.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise through password hash extraction leading to privilege escalation, lateral movement, and complete control of the ZimaOS device and connected systems.

🟠

Likely Case

Unauthorized access to sensitive configuration files, password hashes, and system data leading to credential theft and potential privilege escalation.

🟢

If Mitigated

Limited impact if proper network segmentation and access controls prevent unauthorized users from reaching the API endpoint.

🌐 Internet-Facing: HIGH - If the ZimaOS API is exposed to the internet, attackers can exploit this vulnerability remotely after obtaining valid credentials.
🏢 Internal Only: HIGH - Even internally, authenticated users or compromised accounts can exploit this vulnerability to escalate privileges.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation is straightforward - simply modify the 'files' parameter in the API request. A YouTube demonstration video is publicly available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: None available

Vendor Advisory: https://github.com/IceWhaleTech/ZimaOS/security/advisories/GHSA-hjw2-9gq5-qgwj

Restart Required: No

Instructions:

No official patch available. Monitor the ZimaOS GitHub repository for security updates and apply when released.

🔧 Temporary Workarounds

API Endpoint Restriction

linux

Restrict access to the vulnerable API endpoint using network controls or web application firewall rules.

# Use iptables to block access to the API port
sudo iptables -A INPUT -p tcp --dport <ZIMA_PORT> -j DROP
# Alternative: Allow only specific IPs
sudo iptables -A INPUT -p tcp --dport <ZIMA_PORT> -s <TRUSTED_IP> -j ACCEPT
sudo iptables -A INPUT -p tcp --dport <ZIMA_PORT> -j DROP

Application Layer Filtering

linux

Implement input validation at the application layer or reverse proxy to sanitize file path parameters.

# Example nginx configuration to block malicious requests
location /v3/file {
    if ($args ~* "\.\.") {
        return 403;
    }
    # Additional validation rules
}

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate ZimaOS systems from critical infrastructure
  • Enforce principle of least privilege for user accounts and regularly rotate credentials

🔍 How to Verify

Check if Vulnerable:

Test by making an authenticated API request to http://<Zima_Server_IP:PORT>/v3/file?token=<valid_token>&files=/etc/shadow and checking if the shadow file contents are returned.

Check Version:

Check ZimaOS version through web interface or system documentation. No standard CLI command provided by vendor.

Verify Fix Applied:

After applying workarounds or future patches, repeat the test request to confirm access to sensitive files is blocked.

📡 Detection & Monitoring

Log Indicators:

  • API requests to /v3/file with unusual file paths like /etc/shadow, /etc/passwd, or paths containing ../ sequences
  • Multiple failed authentication attempts followed by successful API access

Network Indicators:

  • Unusual outbound connections from ZimaOS system after API exploitation
  • Traffic patterns showing sequential file access attempts through the API

SIEM Query:

source="zimaos_logs" AND uri_path="/v3/file" AND (query_parameters CONTAINS "/etc/shadow" OR query_parameters CONTAINS "../")

🔗 References

📤 Share & Export