CVE-2024-25390
📋 TL;DR
A heap buffer overflow vulnerability in RT-Thread's command shell components allows attackers to execute arbitrary code or cause denial of service. This affects all systems running RT-Thread RTOS up to version 5.0.2, particularly embedded devices and IoT systems using this real-time operating system.
💻 Affected Systems
- RT-Thread Real-Time Operating System
📦 What is this software?
Rt Thread by Rt Thread
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, device takeover, or persistent malware installation.
Likely Case
Denial of service causing system crashes or instability, potentially leading to device malfunction in critical systems.
If Mitigated
Limited impact if shell access is restricted or disabled, though buffer overflow could still be triggered through other vectors.
🎯 Exploit Status
Exploitation requires access to the command shell interface. Public technical details and proof-of-concept information are available in security advisories.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 5.0.3 and later
Vendor Advisory: https://github.com/RT-Thread/rt-thread/issues/8286
Restart Required: Yes
Instructions:
1. Update RT-Thread to version 5.0.3 or later. 2. Rebuild and redeploy the firmware/application. 3. Restart affected devices.
🔧 Temporary Workarounds
Disable vulnerable shell components
allDisable finsh and msh command shell interfaces if not required for operation.
# In RT-Thread configuration, disable: RT_USING_FINSH and RT_USING_MSH
Restrict shell access
allImplement access controls to limit who can access the command shell interface.
# Configure authentication and network access controls for shell interfaces
🧯 If You Can't Patch
- Implement network segmentation to isolate RT-Thread devices from untrusted networks
- Monitor for abnormal shell access attempts and buffer overflow patterns in system logs
🔍 How to Verify
Check if Vulnerable:
Check RT-Thread version: if version <= 5.0.2 and finsh/msh components are enabled, system is vulnerable.
Check Version:
Check RT-Thread version in source code or via system information commands if shell is accessible.
Verify Fix Applied:
Verify RT-Thread version is 5.0.3 or later and confirm finsh/msh components have been updated.
📡 Detection & Monitoring
Log Indicators:
- Unusual shell command patterns
- System crashes or restarts after shell access
- Buffer overflow error messages
Network Indicators:
- Unexpected connections to shell ports (typically 23/tcp for telnet or custom ports)
- Malformed data sent to shell interfaces
SIEM Query:
source="rt-thread" AND (event="buffer_overflow" OR event="segmentation_fault" OR cmd="*overflow*")
🔗 References
- http://www.openwall.com/lists/oss-security/2024/03/05/1
- https://github.com/RT-Thread/rt-thread/issues/8286
- https://github.com/hnsecurity/vulns/blob/main/HNS-2024-05-rt-thread.txt
- https://seclists.org/fulldisclosure/2024/Mar/28
- https://security.humanativaspa.it/multiple-vulnerabilities-in-rt-thread-rtos/
- http://seclists.org/fulldisclosure/2024/Mar/28
- http://www.openwall.com/lists/oss-security/2024/03/05/1
- https://github.com/RT-Thread/rt-thread/issues/8286
- https://github.com/hnsecurity/vulns/blob/main/HNS-2024-05-rt-thread.txt
- https://seclists.org/fulldisclosure/2024/Mar/28
- https://security.humanativaspa.it/multiple-vulnerabilities-in-rt-thread-rtos/