Zephyr RTOS: Use-after-free in CAN subsystem (CVE-2026-85035)
A use-after-free vulnerability in the Zephyr RTOS CAN subsystem allows unprivileged user-mode threads to trigger kernel heap corruption via dangling pointers in the can_add_rx_filter_msgq() system call.
CVE search metadata
CVE search record: CVE-2026-85035. Severity: high. CVSS: 8.8. KEV: no. Product: Zephyr RTOS (< patched version). Brief: Zephyr RTOS: Use-after-free in CAN subsystem (CVE-2026-85035). Brief link: https://feed.craftedsignal.io/briefs/2026-11-zephyr-can-uaf/
Triage facts
Revision 1- Applicability
- Zephyr RTOS (< patched version)
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 1 public source
- Freshness
- Revision 1Nov 3, 16:01 UTC
- Vulnerabilities
- 1 CVE
- Source quality
- A6Likely
CVE-2026-85035 is a use-after-free vulnerability in the Zephyr RTOS CAN subsystem. The system call can_add_rx_filter_msgq() fails to validate the lifetime of struct k_msgq objects passed as user_data for filter callbacks. When CONFIG_USERSPACE and CONFIG_DYNAMIC_OBJECTS are enabled, an unprivileged thread can register a dynamically allocated message queue, release the object while the kernel retains a pointer to it, and trigger heap corruption when a CAN frame is processed. This enables potential privilege escalation by overwriting kernel structures.
Attack Chain
- Attacker ensures
CONFIG_USERSPACEandCONFIG_DYNAMIC_OBJECTSare active in the target Zephyr image. - Attacker obtains permission to interface with a CAN device.
- Attacker allocates a message queue using
k_object_alloc(K_OBJ_MSGQ)andk_msgq_alloc_init(). - Attacker registers the queue via
can_add_rx_filter_msgq(), which places a raw pointer to the queue in the kernel filter table. - Attacker calls
k_object_release()or terminates, causing the kernel to free the queue memory while the filter remains active. - Attacker grooms the kernel heap to place controlled data in the memory previously occupied by the queue.
- A CAN frame matching the filter is received, triggering
can_msgq_put()in supervisor context against the now-controlled memory, leading to heap corruption.
Recommendation
- Apply the official Zephyr Project patch that enforces
K_SYSCALL_OBJ_STATIC()validation forcan_add_rx_filter_msgq(). - For firmware developers, ensure that dynamically allocated message queues are not used in conjunction with CAN RX filters in user-mode contexts.
Threat Hunt
Identify use of dynamic message queues with CAN subsystems in user-mode accessible firmware
Data: Source code analysis or firmware binary analysis for K_OBJ_MSGQ usage in can_add_rx_filter_msgq
Mitigations
Patch Zephyr RTOS firmware to use static message queue validation
CVE-2026-85035