GHSA-f53h-37j4-mqxx: Out-of-bounds Read and Unverified Entry Pointers in the ThreadX Module Loader

GHSA ID

GHSA‑f53h‑37j4‑mqxx

CVE ID

CVE‑2026‑102711

Severity

Medium

CWE

CWE-125, CWE-345, CWE-1284

Published

2026‑11‑01

Last updated

2026‑11‑01

Affected packages

Package Vulnerable versions Patched versions

ThreadX

>= 6.0.1, ⇐ 6.5.2.202603

6.5.2.202603b

Description

Summary

The Module Manager’s loaders take only a pointer to a module image, never its length, so every size and offset in the image’s preamble is trusted as given. An inflated code_size makes txm_module_manager_memory_load read past the end of the image, and makes txm_module_manager_in_place_load and the absolute loaders give the module access to whatever memory follows its image. Separately, the module’s entry points are computed from preamble offsets that are checked only for being non-zero, so a crafted preamble can place the module’s execution entry outside its code.

Details

_txm_module_manager_memory_load copies code_size bytes from the image into the Module Manager’s byte pool. code_size comes from the preamble and is never compared with the length of the image, which the API does not receive, so an inflated value reads past the end of the source buffer, in privileged code, and places the bytes read in the module’s code area, which a user-mode module can read. The destination is sized from the same field with overflow checks, so nothing is written out of bounds.

_txm_module_manager_in_place_load and the absolute loaders copy nothing, but they set the module’s code region from code_size, and the port’s memory protection setup then grants a user-mode, memory-protected module read and execute access to that region. An inflated code_size therefore extends the module’s access over whatever follows its image in flash or RAM, with the same consequence as the copy. txm_module_manager_file_load is not affected by this part: it refuses an image whose file does not supply code_size bytes.

_txm_module_manager_internal_load computes the shell entry, start, stop and callback functions as the code start plus a preamble offset. Only the shell entry and start offsets were checked, and only for being non-zero; nothing bounded any entry to the module’s code, and a zero callback offset started the callback thread at the preamble. The absolute loaders took the four entry addresses from the preamble unchanged. The preamble’s checksum field is never verified; it is optional and no algorithm is defined for it.

Impact

A module image whose preamble declares a larger code_size than the image discloses the memory that follows the image to the module: on memory_load through a privileged copy into the module’s code area, and on in_place_load and the absolute loaders through the module’s code region. The memory read is adjacent to the image rather than chosen freely. On a target with memory protection, a read that reaches unmapped memory faults. An entry point outside the module’s code does not escalate privilege: a user-mode, memory-protected module’s thread starts unprivileged and faults on its first instruction outside the module’s regions, and a privileged module already runs with kernel privilege. It removes a control-flow integrity check that integrators may rely on.

Affected configurations

Systems that use the Module Manager on any module port and load module images an attacker can supply through txm_module_manager_memory_load, txm_module_manager_in_place_load, txm_module_manager_absolute_load or txm_module_manager_absolute_load_extended. The entry-point gap also affects txm_module_manager_file_load.

Affected versions: [6.0.1, 6.5.2.202603]. 6.0.1 is the first release with the Module Manager. The absolute loaders were added in 6.1.3 and 6.5.2.202603 respectively.

Severity

CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N, CVSS-B 6.9 (Medium). CWE-125: Out-of-bounds Read; CWE-345: Insufficient Verification of Data Authenticity; CWE-1284: Improper Validation of Specified Quantity in Input.

The attacker is the author of a module the device loads, with no separate human interaction. Where an operator must explicitly select or install the module before it is loaded, UI:P or UI:A applies instead.

Patches

Fixed in ThreadX 6.5.2.202603b. Three new loaders take the length of the image: txm_module_manager_in_place_load_ext, txm_module_manager_memory_load_ext and txm_module_manager_absolute_load_ext, the last taking an optional data location so that it replaces both absolute loaders. They refuse, before reading anything else, an image shorter than the preamble or a code_size larger than the image. Every loader, old and new, now bounds each computed entry point to the module’s code, requires a callback entry, and refuses a code_size smaller than the preamble. txm_module_manager_absolute_load, txm_module_manager_absolute_load_extended, txm_module_manager_in_place_load and txm_module_manager_memory_load are deprecated: they remain available and gain the entry-point checks, but cannot check code_size against an image length they do not receive. A new regression test covers every loader and fails when any one of the checks is reverted. The reporter’s suggestion to verify the preamble checksum was not adopted: the field has no defined algorithm and is zero in existing modules, and a checksum the module’s author can recompute does not establish authenticity, which remains the application’s responsibility, for example by verifying a signature before loading.

Workarounds

Load untrusted modules only through txm_module_manager_file_load, which bounds the image by the file length but not the entry points, or verify the module image, including its preamble and entry offsets, before loading it.

Credits

Reported by @adawn0106. Fixed by Frédéric Desbiens.

The fix and regression test were produced with AI assistance under human review, in accordance with the Eclipse Foundation’s Generative AI Usage Guidelines.