CVE-2026-105415: Out-of-bounds write via unchecked channel index in ESP32 MCPWM PWM driver set_cycles syscall

Published Nov 29, 2026
·
Updated

The Espressif MCPWM PWM driver (drivers/pwm/pwmmcesp32.c) indexed its per-channel configuration array config->channelconfig[] with the caller-supplied channelidx in mcpwmesp32setcycles() without any bounds check; the existing if (!channel) test can never fail. The driver then wrote channel->freq, channel->duty and channel->inverted through the out-of-bounds element and used out-of-bounds timerid/operatorid/generatorid values to index MCPWM hardware registers.

pwmsetcycles() is a system call, and neither zvrfypwmsetcycles() nor zimplpwmsetcycles() validates the channel. With CONFIGUSERSPACE enabled on an Espressif RISC-V SoC with PMP (ESP32-C6, and ESP32-C5 in later code), an unprivileged user-mode thread that has been granted access to the MCPWM device can pass an arbitrary channel number and cause the kernel-mode driver to write outside the array.

The configuration object is a writable static in kernel RAM, so this gives a user thread a partially controlled kernel memory write (and stray peripheral register writes), which can crash the system and may be leveraged for privilege escalation. Builds without CONFIGUSERSPACE are not affected in a security sense, since only trusted code can call the driver. The fix adds a channel bounds check to mcpwmesp32setcycles().

Affected Software

1 affected component
Zephyr Project Zephyr

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Add a bounds check for channel_idx in mcpwm_esp32_set_cycles() before indexing config->channel_config[].

Event History

Nov 29, 2026
CVE Published
via MITRE·08:56 PM
Data Sourced
via MITRE·08:56 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are meaningfully exposed to this issue?

Security exposure requires CONFIG_USERSPACE on an Espressif RISC-V SoC with PMP, identified as ESP32-C6 and ESP32-C5 in later code. An unprivileged user-mode thread must also have been granted access to the MCPWM device.

2

What must an attacker be able to do?

The attacker needs to run an unprivileged user-mode thread with MCPWM device access and invoke pwm_set_cycles() with an arbitrary channel number. No user interaction is required.

3

What could successful exploitation cause?

The unchecked channel value can produce a partially controlled write to kernel RAM and unintended MCPWM peripheral-register writes. This can crash the system and may be leveraged for privilege escalation.

4

Are builds without userspace affected as a security boundary issue?

Builds without CONFIG_USERSPACE are not affected in a security sense, because there is no unprivileged user-mode caller crossing into the kernel-mode driver.

5

How can I assess whether a device is exposed?

Check whether CONFIG_USERSPACE is enabled, whether the target is an affected Espressif RISC-V SoC with PMP, and whether unprivileged threads have access to an MCPWM device. All of these conditions are needed for the described security impact.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203