GHSA-q2rc-f35r-2hw6: User-mode module can post forged callback requests to another module’s callback queue, running its code with that module’s privilege

GHSA ID

GHSA‑q2rc‑f35r‑2hw6

CVE ID

CVE‑2026‑115231

Severity

High

CWE

CWE-269, CWE-862

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

A user-mode, memory-protected module can post a forged callback request to another module’s callback request queue. The receiving module’s callback thread calls the function pointer in that request without checking that the Module Manager sent it, so the attacking module’s code runs on the receiving module’s callback thread with that module’s privilege. When the receiving module runs in privileged mode, a user-mode module gains privileged execution, defeating the isolation the Module Manager provides.

Details

_txm_module_manager_start() creates a callback request queue for every module, in Module Manager memory outside all modules, and only the Module Manager is meant to post to it: the notify trampolines queue a TXM_MODULE_CALLBACK_MESSAGE naming the module’s own callback function when a timer expires or an object’s notify fires.

Nothing stops a module from posting to another module’s queue. tx_queue_info_get() returns the next queue on the kernel’s created list, so a module walking the list reaches every module’s callback request queue. _txm_module_manager_tx_queue_send_dispatch() accepts any live queue object outside the calling module, and a callback request queue is one. A module can therefore send a message of type TXM_QUEUE_SEND_CALLBACK, or any other callback type, naming a function of its choosing and its argument.

_txm_module_callback_request_thread_entry(), the receiving module’s callback worker, takes each message from its queue and calls txm_module_callback_message_application_function with the message’s parameters. It does not establish that the message came from the Module Manager or that the function belongs to the receiving module.

The same queues can also be sent to at the front, received from and flushed by other modules, which lets a module consume or discard another module’s legitimate callbacks.

Impact

A user-mode module executes code of its choosing on another module’s callback thread. If that module runs in privileged mode, the code runs with privilege; the reporter reproduced this on Cortex-M3 under QEMU (mps2-an385), with the attacking module’s function observed running with CONTROL.nPRIV = 0 and writing to the receiving module’s queue control block, without faults. A privileged module has the access of the kernel, so this is equivalent to module-to-kernel privilege escalation. If the receiving module also runs in user mode, the attacker can still call functions in the receiving module’s context with chosen arguments, or fault its callback thread. Separately, draining another module’s queue suppresses that module’s callbacks.

Affected configurations

Systems that use the Module Manager and load at least one user-mode, memory-protected module that an attacker controls. Privilege escalation additionally requires another loaded module that runs in privileged mode. No special build option is needed.

Affected versions: [6.0.1, 6.5.2.202603]. The object authentication added in 6.5.2.202603 does not prevent it, because a callback request queue is a genuine live queue.

Severity

CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N, 8.5 (High). CWE-862, CWE-269.

The flaw and its impact are both on the device, so the subsequent-system metrics are None. The need for a privileged module alongside the attacker’s is a deployment condition, stated above rather than scored as an attack requirement.

Patches

Fixed in ThreadX 6.5.2.202603b. The queue dispatchers now refuse a memory-protected module’s send, front-send, flush, prioritize and send-notify requests on any module’s callback request queue, and its receive requests on any callback request queue but its own, with TXM_MODULE_INVALID_MEMORY. The Module Manager marks the queues it creates with a name pointer a module cannot assign, so the check needs no list walk. Modules without memory protection are unaffected. A new regression test exercises every gated service and fails without the fix.

Credits

Reported by SounLabs.