☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2024-24335

CVE-2024-24335 Buffer Overflow in Rt-thread
📅 PUBLISHED: 2024-03-27 00:00 UTC 🔄 UPDATED: 2026-09-23 20:38 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.40%
👁️
0.40% probability
10.1× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-24335 is a heap buffer overflow vulnerability in the dfs_v2 romfs filesystem component of RT-Thread, an open-source real-time operating system. The flaw exists in all versions up to and including 5.0.2. An attacker can trigger a heap-based buffer overflow by providing a specially crafted romfs filesystem image, potentially leading to arbitrary code execution or denial of service. No public exploit code or patch is currently available. The vulnerability is classified under CWE-122 (Heap-based Buffer Overflow) and aligns with MITRE ATT&CK tactic T1203 (Exploitation for Client Execution).

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

RT-Thread is a widely used RTOS in IoT and embedded systems. The vulnerability in its filesystem component (romfs) can be exploited via maliciously crafted filesystem images, which may be introduced through firmware updates, removable media, or network file shares. Since RT-Thread is often distributed as source code or precompiled libraries, downstream integrators must verify the integrity of any romfs images they process. No official patch or advisory has been released by the vendor as of this report.

CVSS Breakdown & Threat Level

The CVSS score is listed as 0.0, indicating that no official CVSS vector has been assigned. Based on the nature of the vulnerability (heap buffer overflow in a filesystem driver), a reasonable estimated vector would be:

  • Attack Vector (AV): Local (L) – requires access to the device to mount a malicious filesystem.
  • Attack Complexity (AC): Low (L) – no special conditions.
  • Privileges Required (PR): Low (L) – attacker needs user-level access to mount filesystem.
  • User Interaction (UI): None (N) – no user action required beyond mounting.
  • Scope (S): Unchanged (U) – vulnerability does not cross trust boundaries.
  • Confidentiality (C): High (H) – potential for arbitrary read.
  • Integrity (I): High (H) – potential for arbitrary write.
  • Availability (A): High (H) – crash or denial of service.

Estimated CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Estimated Base Score: 7.8 (High)

Deep Dive & Mechanics

The vulnerability resides in the dfs_v2 romfs filesystem implementation within RT-Thread. The romfs (ROM filesystem) is a simple, read-only filesystem used for storing firmware data. The heap buffer overflow occurs when parsing a crafted romfs image, specifically during the handling of directory entries or file metadata.

The dfs_v2 layer provides a virtual filesystem interface, and the romfs driver reads data from a memory-mapped region. When the driver processes a malformed romfs image, it may copy data into a heap buffer without proper bounds checking, leading to a heap overflow. This can corrupt adjacent heap metadata or data, potentially allowing an attacker to overwrite function pointers or other critical structures.

The vulnerability is triggered by mounting a malicious romfs image. Since romfs is often used for firmware updates or boot images, an attacker with physical or logical access to the device could supply a crafted image to exploit the flaw.

Vulnerable vs. Patched Code

No patched code is available. The vulnerable code is in the romfs driver of RT-Thread (version <= 5.0.2). The likely vulnerable function is in the dfs_romfs.c file, where a buffer is allocated on the heap and data is copied from the romfs image without proper length validation.

Vulnerable code snippet (conceptual):

// Vulnerable: no bounds check on romfs entry size
char *buf = (char *)rt_malloc(size);
memcpy(buf, romfs_data, size); // size may be attacker-controlled

Patched code (hypothetical):

// Patched: validate size before allocation
if (size > MAX_ROMFS_ENTRY_SIZE) {
    return -RT_ERROR;
}
char *buf = (char *)rt_malloc(size);
if (buf == NULL) {
    return -RT_ENOMEM;
}
memcpy(buf, romfs_data, size);

Exploitation & Lab Setup

Red Team

To exploit CVE-2024-24335, an attacker would need to craft a malicious romfs filesystem image that triggers a heap overflow when mounted. The following steps outline a potential exploitation scenario:

  1. Craft a malicious romfs image: Use a hex editor or custom tool to create a romfs image with an oversized directory entry or file metadata field.
  2. Deliver the image: Transfer the image to the target device via USB, network file share, or firmware update mechanism.
  3. Mount the image: On the RT-Thread device, mount the malicious image using the mount command or programmatically.
  4. Trigger overflow: The romfs driver processes the image, causing a heap buffer overflow.
  5. Achieve code execution: Overwrite a function pointer or return address to redirect execution to attacker-controlled shellcode.

Example exploit script (conceptual):

# Craft a malicious romfs image with oversized entry
import struct

def create_malicious_romfs():
    # Romfs header
    header = b"romfs" + struct.pack("<I", 0x1000)  # size field
    # Oversized entry
    entry = b"A" * 0x2000  # triggers overflow
    return header + entry

with open("malicious.romfs", "wb") as f:
    f.write(create_malicious_romfs())

Blue Team

To detect exploitation attempts:

  1. Monitor filesystem mount operations: Log all mount calls and inspect the source of romfs images.
  2. Heap integrity checks: Enable heap debugging features in RT-Thread (e.g., RT_USING_HEAP_DEBUG) to detect corruption.
  3. Network monitoring: If the image is delivered over the network, monitor for unusual file transfers.
  4. Static analysis: Scan incoming romfs images for oversized fields or malformed headers.

Detection rule (conceptual):

# Monitor for large romfs mounts
journalctl | grep -i "romfs" | grep -i "mount"

Indicators of Compromise (IOCs)

  • File Hashes: Malicious romfs images with oversized entries (e.g., entry size > 0x1000 bytes).
  • Network Indicators: Unusual file transfers of .romfs files from untrusted sources.
  • System Logs: Heap corruption errors or crashes in the dfs_romfs driver.
  • Memory Artifacts: Heap memory containing large contiguous blocks of data (e.g., "AAAA...").

Detection Engineering

YARA Rule

rule CVE_2024_24335_romfs_heap_overflow {
    meta:
        description = "Detects malicious romfs images exploiting CVE-2024-24335"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2024-24335"
    strings:
        $romfs_magic = "romfs"
        $large_size = { 00 10 00 00 } // size >= 0x1000
    condition:
        $romfs_magic at 0 and $large_size
}

Sigma Rule

title: CVE-2024-24335 Heap Overflow in RT-Thread romfs
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects attempts to mount a malicious romfs image with oversized entries
author: Valters IT
logsource:
    product: rt-thread
    service: dfs
detection:
    selection:
        EventID: 1001  # Example: mount event
        Filesystem: "romfs"
        Size: "> 4096"  # Oversized entry
    condition: selection
falsepositives:
    - Legitimate large romfs images (rare)
level: high

Suricata Rule

alert tcp any any -> any any (msg:"CVE-2024-24335 Potential romfs heap overflow"; flow:to_server; content:"romfs"; offset:0; depth:5; content:"|00 10 00 00|"; within:4; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

  1. Apply vendor patch: Monitor RT-Thread's official repository for a patch addressing CVE-2024-24335.
  2. Input validation: Implement strict bounds checking when parsing romfs images in the dfs_v2 driver.
  3. Heap hardening: Enable heap protection features (e.g., canaries, ASLR) in RT-Thread builds.
  4. Access control: Restrict the ability to mount filesystems to trusted users or processes.
  5. Network segmentation: Isolate devices running RT-Thread from untrusted networks.
  6. Firmware signing: Verify the integrity and authenticity of all romfs images before mounting.

Valters IT
DevSecOps & Cyber Threat Intelligence

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-24335/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.