CVE-2026-18414
Received Received - Intake

Buffer Overflow in Zephyr RTOS ADC MAX32 Driver

Vulnerability report for CVE-2026-18414, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-09-28

Last updated on: 2026-09-28

Assigner: Zephyr Project

Description

The ADC API requires each driver to reject a sampling sequence whose destination buffer is too small: the buffer_size field of struct adc_sequence in include/zephyr/drivers/adc.h documents that "the driver must ensure that samples are not written beyond the limit and it must return an error if the buffer turns out to be not large enough". The ADI MAX32 driver did not honour that contract. start_read() in drivers/adc/adc_max32.c compared buffer_size, a byte count, against a sample count ((1 + extra_samplings) channels), ignoring sizeof(uint16_t), so it accepted a buffer half the required size. The samples are then stored through the uint16_t data->buffer by Wrap_MXC_ADC_GetData(), which writes two bytes per sample and advances the pointer by one uint16_t: in adc_max32_start_channel() for synchronous reads, and in adc_max32_isr() for asynchronous ones. A sequence selecting two channels with a two-byte buffer, for example, passes the check and has its second sample written past the end of the buffer. On a build with CONFIG_USERSPACE, adc_read() and adc_read_async() are system calls. The handler in drivers/adc/adc_handlers.c copies the sequence in from user memory, verifies only that [buffer, buffer + buffer_size) is writable by the calling thread, and rejects a user-supplied options->callback; it deliberately leaves the size arithmetic to the driver. A user-mode thread that has been granted access to a MAX32 ADC device object therefore fully controls channels, buffer, buffer_size and options->extra_samplings, and can make the driver write twice as many bytes as its buffer holds. Because the check scales with extra_samplings, the overrun equals the length of the buffer itself, up to channels * 65536 bytes past its end, since the sample pointer is only rewound on a repeat sampling, never on the extra samplings of a sequence. The resulting stores are performed by the driver in kernel mode (in the system call itself, the ADC context timer, or the ADC interrupt handler for asynchronous reads), where the MPU does not restrict the thread's memory domain, so the write walks linearly out of the user partition and into adjacent memory such as other partitions, kernel data or thread stacks. The impact is kernel-memory corruption of attacker-chosen length at an attacker-chosen offset, a plausible privilege-escalation and denial-of-service primitive from an unprivileged user-mode thread. Builds without CONFIG_USERSPACE are affected only as a caller-side robustness defect, since the application itself supplies the buffer. The fix replaces that check in start_read() with a call to the new shared helper adc_sequence_validate_buffer() in drivers/adc/adc_common.c, passing sizeof(uint16_t) as the sample size. The helper computes active_channels sizeof(uint16_t) (1 + extra_samplings) and returns -ENOMEM before any sampling is started.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-09-28
Last Modified
2026-09-28
Generated
2026-09-29
AI Q&A
2026-09-29
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
zephyrproject zephyr From CONFIG_USERSPACE (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is a buffer overflow in the ADC API of the Zephyr RTOS. The ADI MAX32 driver incorrectly validated buffer sizes by comparing byte counts to sample counts without accounting for the 2-byte size of each sample (uint16_t). This allowed an attacker to provide a buffer half the required size, leading to writes past the buffer's end. The issue is exacerbated in builds with CONFIG_USERSPACE, where unprivileged user-mode threads can exploit this to corrupt kernel memory.

Detection Guidance

This vulnerability is specific to systems running the Zephyr RTOS with the ADI MAX32 ADC driver and CONFIG_USERSPACE enabled. Detection requires checking for kernel memory corruption or crashes during ADC operations. Monitor system logs for kernel panics or memory access violations. Review ADC driver code for improper buffer size validation in start_read().

Impact Analysis

An attacker with access to the MAX32 ADC device can exploit this to corrupt kernel memory, potentially escalating privileges or causing denial of service. The impact includes arbitrary memory writes at attacker-chosen offsets, which could overwrite critical kernel data, thread stacks, or other partitions. Systems without CONFIG_USERSPACE are less affected, as the vulnerability only impacts buffer validation.

Compliance Impact

This vulnerability allows an unprivileged user-mode thread to corrupt kernel memory by writing beyond a buffer's allocated size. This could lead to privilege escalation or denial of service, potentially compromising system integrity. For GDPR, this may violate Article 32 (security of processing) if personal data processing is affected. For HIPAA, it could impact integrity and availability requirements under the Security Rule.

Mitigation Strategies

Apply the provided fix by updating to a patched version of the Zephyr RTOS that includes the adc_sequence_validate_buffer() helper. If immediate patching is not possible, disable CONFIG_USERSPACE or restrict access to ADC devices to trusted users. Monitor for unusual kernel behavior or crashes.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-18414. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart