CVE-2022-24796
📋 TL;DR
CVE-2022-24796 is a critical remote code execution vulnerability in RaspberryMatic's WebUI file upload feature. Unauthenticated attackers with network access can execute arbitrary commands as root via shell metacharacter injection in HTTP queries, leading to complete system compromise. All RaspberryMatic installations with versions after 2.31.25.20180428 and before 3.63.8.20220330 are affected.
💻 Affected Systems
- RaspberryMatic
📦 What is this software?
Raspberrymatic by Raspberrymatic
⚠️ Risk & Real-World Impact
Worst Case
Complete system takeover with root privileges, allowing attackers to install malware, steal data, pivot to other systems, or render the smart-home system inoperable.
Likely Case
Remote attackers gaining full control of the RaspberryMatic system, accessing smart-home devices, and potentially compromising the entire home network.
If Mitigated
No impact if system is properly patched or isolated from untrusted networks.
🎯 Exploit Status
Exploitation requires only network access to the WebUI port (typically 80/443) and sending crafted HTTP requests with shell metacharacters.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.63.8.20220330 or newer
Vendor Advisory: https://github.com/jens-maus/RaspberryMatic/security/advisories/GHSA-g7vv-7rmf-mff7
Restart Required: Yes
Instructions:
1. Backup current configuration. 2. Download latest RaspberryMatic version from official repository. 3. Perform system update via WebUI or manual installation. 4. Reboot system. 5. Verify version is 3.63.8.20220330 or newer.
🔧 Temporary Workarounds
Network Isolation
linuxRestrict network access to RaspberryMatic WebUI interface to trusted hosts only.
iptables -A INPUT -p tcp --dport 80 -s TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -s TRUSTED_IP -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
iptables -A INPUT -p tcp --dport 443 -j DROP
🧯 If You Can't Patch
- Disable WebUI interface completely if not needed for operations.
- Place RaspberryMatic system on isolated VLAN with no internet or untrusted network access.
🔍 How to Verify
Check if Vulnerable:
Check current RaspberryMatic version via WebUI dashboard or SSH connection. If version is between 2.31.25.20180428 and 3.63.8.20220330 (exclusive), system is vulnerable.
Check Version:
cat /VERSION or check WebUI dashboard
Verify Fix Applied:
Confirm version is 3.63.8.20220330 or newer. Test file upload functionality with safe test files to ensure proper input validation.
📡 Detection & Monitoring
Log Indicators:
- Unusual file upload attempts in WebUI logs
- Shell command execution patterns in system logs
- Multiple failed or unusual HTTP requests to upload endpoints
Network Indicators:
- HTTP POST requests to upload endpoints containing shell metacharacters
- Unusual outbound connections from RaspberryMatic system
SIEM Query:
source="raspberrymatic" AND (url="*upload*" AND (request="*;*" OR request="*|*" OR request="*`*" OR request="*$(*"))
🔗 References
- https://github.com/jens-maus/RaspberryMatic/commit/34854659a63e9fb3ad529bb413e96978c6450a53
- https://github.com/jens-maus/RaspberryMatic/security/advisories/GHSA-g7vv-7rmf-mff7
- https://github.com/jens-maus/RaspberryMatic/commit/34854659a63e9fb3ad529bb413e96978c6450a53
- https://github.com/jens-maus/RaspberryMatic/security/advisories/GHSA-g7vv-7rmf-mff7