Skip to content

Eclipse ThreadX FileX RAM disk driver buffer overflow vulnerability

Critical
mrybczyn published GHSA-467v-6j75-3j7g Oct 16, 2025

Package

FileX (Eclipse ThreadX)

Affected versions

<= 6.4.1

Patched versions

6.4.2

Description

Summary

A buffer overflow vulnerability exists in the FileX RAM disk driver functionality of Eclipse ThreadX FileX git commit 1b85eb2. A specially crafted set of network packets can lead to code execution. An attacker can send a sequence of requests to trigger this vulnerability.

Confirmed Vulnerable Versions

The versions below were either tested or verified to be vulnerable by Talos or confirmed to be vulnerable by the vendor.

Eclipse ThreadX FileX git commit 1b85eb2

Product URLs

Eclipse ThreadX FileX - https://github.com/eclipse-threadx/filex

Details

FileX is a high-performance, FAT-compatible file system is seamlessly integrated with the Eclipse ThreadX RTOS and is available for all supported processors. Similar to Eclipse ThreadX RTOS, FileX is designed to be compact and efficient, making it perfect for modern deeply embedded applications that need file management capabilities. FileX supports a variety of physical media, including RAM, Eclipse ThreadX USBX, SD CARD, and NAND/NOR flash memories through Eclipse ThreadX LevelX.

The NetXDuo http server sample implementation is used to demonstrate this vulnerability. However, this vulnerability affects any application using the RAM disk driver with a vulnerable configuration. The initial values for configuring the RAM disk driver are copied from that sample code provided in the NetXDuo repository https://github.com/eclipse-threadx/netxduo/blob/master/samples/demo_netxduo_https.c.

The RAM disk driver is initialized during application start up with a call to the function fx_media_format. Below is an example of this initialization:

fx_media_format(&ram_disk,
                _fx_ram_driver,               // Driver entry
                demo.ram_disk_memory,              // RAM disk memory pointer   /*[1] size 4096*/
                media_memory,              // Media buffer pointer
                sizeof(media_memory),      // Media buffer size
                "MY_RAM_DISK",                // Volume Name
                1,                            // Number of FATs
                32,                           // Directory Entries
                0,                            // Hidden sectors
                256,                          // Total sectors  /*[2]*/
                512,                          // Sector size    /*[3]*/
                8,                            // Sectors per cluster
                1,                            // Heads
                1);                           // Sectors per track   

The Total sectors ([2]) multiplied by Sector size ([3]) equals 131,072 which is much larger than 4096 bytes allocated for the size of the RAM disk memory pointer at [1]. There are no checks performed to ensure that the RAM disk driver is configured properly, which leads to the vulnerability described below.

When receiving a PUT request, the NetXDuo http server implementation will create and write the specified file and it's contents to the filesystem using the FileX API fx_file_write.

File: nx_web_http_server.c
4213: VOID  _nx_web_http_server_put_process(NX_WEB_HTTP_SERVER *server_ptr, NX_PACKET *packet_ptr)
4214: {
...
4481:         /* Write the content found in this packet.  */
4482:         status =  fx_file_write(&(server_ptr -> nx_web_http_server_file), (packet_ptr -> nx_packet_prepend_ptr + offset),
4483:                                 ((ULONG)(packet_ptr -> nx_packet_append_ptr - packet_ptr -> nx_packet_prepend_ptr) - offset));

After a series of intermediate functions, the RAM disk driver function _fx_ram_driver is called with a WRITE request, which corresponds to the switch case below.

File: fx_ram_driver.c
224:     case FX_DRIVER_WRITE:
225:     {
226: 
227:         /* Calculate the RAM disk sector offset. Note the RAM disk memory is pointed to by
228:            the fx_media_driver_info pointer, which is supplied by the application in the
229:            call to fx_media_open.  */
230:         destination_buffer =  ((UCHAR *)media_ptr -> fx_media_driver_info) +   /*[4]*/
231:             ((media_ptr -> fx_media_driver_logical_sector +
232:               media_ptr -> fx_media_hidden_sectors) *
233:              media_ptr -> fx_media_bytes_per_sector);
234: 
235:         /* Copy the source to the RAM sector.  */
236:         _fx_utility_memory_copy(media_ptr -> fx_media_driver_buffer, destination_buffer,   /*[5]*/
237:                                 media_ptr -> fx_media_driver_sectors *
238:                                 media_ptr -> fx_media_bytes_per_sector);
239: 
240:         /* Successful driver request.  */
241:         media_ptr -> fx_media_driver_status =  FX_SUCCESS;
242:         break;
243:     }

At [4] a pointer to the memory location that should be written to is calculated. The pointer media_ptr -> fx_media_driver_info points to the buffer corresponding to the RAM disk which was provided when the application was initialized at [1]. The value for media_ptr -> fx_media_driver_logical_sector will be incremented until the value provided in the initialization [2]. The value for media_ptr -> fx_media_bytes_per_sector is the Sector size provided during initialization at [3]. The issue is that there is no validation performed to ensure that the calculation above at [4] will not result in the pointer destination_buffer pointing outside the bounds of the provided RAM disk buffer.

As you can see below, the function fx_utility_memory_copy at [5] is simply a wrapper for the libc memcpy function. The result is that user supplied data via an HTTP PUT request will overflow the RAM disk buffer. This buffer overflow could overwrite a function pointer in another object leading to code execution.

File: fx_utility_memory_copy.c
82: VOID  _fx_utility_memory_copy(UCHAR *source_ptr, UCHAR *dest_ptr, ULONG size)
83: {
84: 
85:     /* Copy the memory.  */
86:     memcpy(dest_ptr, source_ptr, size); /* Use case of memcpy is verified. */
87: }

Crash Information

Program received signal SIGSEGV, Segmentation fault.
0x41414141 in ?? ()
(gdb) i r
eax            0x5657c000          1448591360
ecx            0x1a                26
edx            0xffffd0f2          -12046
ebx            0x5657c000          1448591360
esp            0xffffd0dc          0xffffd0dc
ebp            0xffffd118          0xffffd118
esi            0x1                 1
edi            0x5657c428          1448592424
eip            0x41414141          0x41414141
eflags         0x10287             [ CF PF SF IF RF ]
cs             0x23                35
ss             0x2b                43
ds             0x2b                43
es             0x2b                43
fs             0x0                 0
gs             0x63                99
k0             0x0                 0
k1             0x0                 0
k2             0x0                 0
k3             0x0                 0
k4             0x0                 0
k5             0x0                 0
k6             0x0                 0
k7             0x0                 0
(gdb) bt
#0  0x41414141 in ?? ()
#1  0x5657667a in server_request_callback (server_ptr=0x5657c428 <my_server>, request_type=1, 
    resource=0x5657c434 <my_server+12> "/test.txt", packet_ptr=0x565881a0)
    at nx_web_http_server/ramdisk_driver_overflow/http_server_app.c:122
#2  0x56570364 in _nx_web_http_server_get_process (server_ptr=0x5657c428 <my_server>, request_type=1, 
    packet_ptr=0x565881a0) at netxduo/addons/web/nx_web_http_server.c:3892
#3  0x5656e10d in _nx_web_http_server_receive_data (tcpserver_ptr=0x5657c660 <my_server+568>, 
    session_ptr=0xffffd2a0) at netxduo/addons/web/nx_web_http_server.c:3242
#4  0x5655a188 in _nx_tcpserver_start (server_ptr=0x5657c660 <my_server+568>, port=8080, listen_queue_size=4)
    at nx_tcp_shims.c:970
#5  0x5656edc2 in _nx_web_http_server_start (http_server_ptr=0x5657c428 <my_server>)
    at netxduo/addons/web/nx_web_http_server.c:2087
#6  0x5656ed6c in _nxe_web_http_server_start (http_server_ptr=0x5657c428 <my_server>)
    at netxduo/addons/web/nx_web_http_server.c:2029
#7  0x565765cc in https_server_thread_entry (thread_input=0)
    at nx_web_http_server/ramdisk_driver_overflow/http_server_app.c:235
#8  0x5655a533 in _txe_thread_create (thread_ptr=0x5657cd28 <server_thread>, 
    name_ptr=0x565772f2 "HTTP Server thread", entry_function=0x565761c0 <https_server_thread_entry>, 
    entry_input=0, stack_start=0x5658cca0, stack_size=4096, priority=4, preempt_threshold=4, time_slice=0, 
    auto_start=1, thread_control_block_size=212) at tx_shims.c:146
#9  0x565761aa in tx_application_define (first_unused_memory=0x565881a0)
    at nx_web_http_server/ramdisk_driver_overflow/http_server_app.c:103
#10 0x5655a4aa in _tx_initialize_kernel_enter () at tx_shims.c:75
#11 0x56576096 in main () at nx_web_http_server/ramdisk_driver_overflow/http_server_app.c:52
(gdb)

Mitigation

Developers should ensure that the provided values for total sectors multiplied by sector size are less than the size of the buffer provided for the ram disk memory when initializing the ramdisk with the call to fx_media_format. In reference to the call above fx_media_format ensure that [2]*[3] < sizeof([1]).

Credit

Discovered by Kelly Patterson of Cisco Talos.

https://talosintelligence.com/vulnerability_reports/

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v4 base metrics

Exploitability Metrics
Attack Vector Network
Attack Complexity High
Attack Requirements Present
Privileges Required None
User interaction None
Vulnerable System Impact Metrics
Confidentiality High
Integrity High
Availability High
Subsequent System Impact Metrics
Confidentiality None
Integrity None
Availability None

CVSS v4 base metrics

Exploitability Metrics
Attack Vector: This metric reflects the context by which vulnerability exploitation is possible. This metric value (and consequently the resulting severity) will be larger the more remote (logically, and physically) an attacker can be in order to exploit the vulnerable system. The assumption is that the number of potential attackers for a vulnerability that could be exploited from across a network is larger than the number of potential attackers that could exploit a vulnerability requiring physical access to a device, and therefore warrants a greater severity.
Attack Complexity: This metric captures measurable actions that must be taken by the attacker to actively evade or circumvent existing built-in security-enhancing conditions in order to obtain a working exploit. These are conditions whose primary purpose is to increase security and/or increase exploit engineering complexity. A vulnerability exploitable without a target-specific variable has a lower complexity than a vulnerability that would require non-trivial customization. This metric is meant to capture security mechanisms utilized by the vulnerable system.
Attack Requirements: This metric captures the prerequisite deployment and execution conditions or variables of the vulnerable system that enable the attack. These differ from security-enhancing techniques/technologies (ref Attack Complexity) as the primary purpose of these conditions is not to explicitly mitigate attacks, but rather, emerge naturally as a consequence of the deployment and execution of the vulnerable system.
Privileges Required: This metric describes the level of privileges an attacker must possess prior to successfully exploiting the vulnerability. The method by which the attacker obtains privileged credentials prior to the attack (e.g., free trial accounts), is outside the scope of this metric. Generally, self-service provisioned accounts do not constitute a privilege requirement if the attacker can grant themselves privileges as part of the attack.
User interaction: This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable system. This metric determines whether the vulnerability can be exploited solely at the will of the attacker, or whether a separate user (or user-initiated process) must participate in some manner.
Vulnerable System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the VULNERABLE SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the VULNERABLE SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the VULNERABLE SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
Subsequent System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the SUBSEQUENT SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the SUBSEQUENT SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the SUBSEQUENT SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

CVE ID

CVE-2025-55089

Weaknesses

Improper Restriction of Operations within the Bounds of a Memory Buffer

The product performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer. Learn more on MITRE.