CVE-2026-102959 in Zephyrinfo

Summary

by MITRE • 11/25/2026

The Grow R502-A fingerprint sensor driver (drivers/sensor/grow_r502a/grow_r502a.c) points drv_data->rx_buf.data at an rx_packet buffer on the caller's stack and enables the UART RX interrupt before waiting 1500 ms for a reply. When the wait timed out, transceive_packet() returned -ETIMEDOUT but left the RX interrupt enabled and rx_buf.data still pointing at the caller's buffer.

Once the caller's frame has returned, any bytes that arrive late on the UART are written by the interrupt handler uart_cb_handler() through the dangling pointer into stack memory that the thread has since reused. The bytes come from the device on the other end of the UART. An attacker with physical access who replaces or impersonates the fingerprint module can trigger this by delaying a reply past the timeout and then sending a packet. A slow or faulty genuine module can also trigger it by accident.

The result is a write of attacker-chosen bytes into a live thread stack. The write length comes from the header of the late packet. Commit 96968fac22b, which landed together with this fix, bounds it to a header plus CONFIG_R502A_DATA_PKT_SIZE bytes; affected releases do not have that bound. This can crash the device and may allow control-flow hijacking, depending on what occupies the reused stack region. The fix disables the RX interrupt, resets the RX semaphore and clears rx_buf.data on timeout, and the interrupt handler now refuses to write when no receive buffer is armed.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/25/2026

The vulnerability in the Grow R502-A fingerprint sensor driver represents a critical memory safety flaw rooted in improper resource management during asynchronous communication timeouts. The core technical issue lies within the transceive_packet function, which initializes a local stack-based buffer for receiving data and assigns its address to drv_data->rx_buf.data before enabling the UART receive interrupt. This design assumes that any incoming data will be processed either successfully or via an immediate timeout handling routine that properly cleans up state variables. However, when the operation times out after 1500 milliseconds without a valid response from the device, the function returns an error code but fails to disable the RX interrupt or clear the pointer reference in drv_data->rx_buf.data. This leaves the system in a dangerous intermediate state where the hardware is still configured to write incoming UART bytes into memory addresses that belong to the now-completed stack frame of the calling thread.

This architectural flaw creates a classic use-after-free scenario applied to kernel stack space, specifically categorized under CWE-416: Use After Free. Because the RX interrupt remains enabled, any subsequent data transmitted by the fingerprint sensor is written directly into the memory region previously occupied by the caller's local variables. In embedded systems like those running Zephyr RTOS, thread stacks are frequently reused for new function calls once a previous task completes or returns. Consequently, late-arriving packets from the UART interface overwrite live stack data rather than being discarded as stale responses to a completed transaction. The write length is determined by the header of the incoming packet, allowing an attacker to control both the destination offset within the overwritten frame and potentially the volume of memory corrupted if bounds checking were not present in earlier versions.

The operational impact of this vulnerability extends beyond simple data corruption or system crashes. An adversary with physical access who replaces the genuine fingerprint module with a malicious one can exploit this condition by deliberately delaying their response until after the driver's timeout period has elapsed, followed immediately by transmitting crafted packets. Alternatively, a faulty or slow legitimate device might trigger the same behavior accidentally due to latency issues on the UART bus. Once the stack is overwritten, the consequences depend heavily on what data resides in that memory region at the time of exploitation. If critical control flow information such as return addresses, saved frame pointers, or function parameters are located within the affected range, an attacker may achieve arbitrary code execution through control-flow hijacking. Even without full privilege escalation, the corruption can lead to denial-of-service conditions by causing kernel panics or unpredictable behavior in concurrent threads sharing the same stack space.

Mitigation strategies for this vulnerability involve strict adherence to defensive programming practices regarding asynchronous interrupt handling and state management. The primary fix implemented involves disabling the RX interrupt immediately upon timeout detection, thereby preventing further writes from occurring after the transaction is deemed failed. Additionally, resetting the receive semaphore ensures that subsequent operations do not incorrectly assume a pending response exists, while clearing drv_data->rx_buf.data removes the dangling pointer reference entirely. It is also crucial for developers to implement bounds checking in the interrupt handler itself, ensuring that even if state management fails, the write operation cannot exceed predefined limits such as CONFIG_R502A_DATA_PKT_SIZE plus header size. From a broader security perspective, this incident highlights the importance of validating all external inputs and managing hardware interrupts with atomicity and completeness to prevent race conditions between timeout logic and interrupt service routines. Adhering to CWE-416 guidelines for use-after-free prevention and considering ATT&CK techniques related to input validation failures can help engineers design more resilient embedded drivers that are resistant to such physical-layer attacks.

Responsible

Zephyr

Reservation

09/29/2026

Disclosure

11/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00283

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!