{"id":"CVE-2026-105415","aliases":["CVE-2026-105415"],"related":[],"kind":"vulnerability","state":"published","title":"Out-of-bounds write via unchecked channel index in ESP32 MCPWM PWM driver set_cycles syscall","summary":"The Espressif MCPWM PWM driver (drivers/pwm/pwm_mc_esp32.c) indexed its per-channel configuration array config->channel_config[] with the caller-supplied channel_idx in mcpwm_esp32_set_cycles() 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 timer_id/operator_id/generator_id values to index MCPWM hardware registers.\n\npwm_set_cycles() is a system call, and neither z_vrfy_pwm_set_cycles() nor z_impl_pwm_set_cycles() validates the channel. With CONFIG_USERSPACE 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.\n\nThe 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 CONFIG_USERSPACE are not affected in a security sense, since only trusted code can call the driver. The fix adds a channel bounds check to mcpwm_esp32_set_cycles().","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The Espressif MCPWM PWM driver (drivers/pwm/pwm_mc_esp32.c) indexed its per-channel configuration array config->channel_config[] with the caller-supplied channel_idx in mcpwm_esp32_set_cycles() 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 timer_id/operator_id/generator_id values to index MCPWM hardware registers.\n\npwm_set_cycles() is a system call, and neither z_vrfy_pwm_set_cycles() nor z_impl_pwm_set_cycles() validates the channel. With CONFIG_USERSPACE 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.\n\nThe 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 CONFIG_USERSPACE are not affected in a security sense, since only trusted code can call the driver. The fix adds a channel bounds check to mcpwm_esp32_set_cycles().","source":"cvelist"}],"published":"2026-11-29T20:56:53.074Z","modified":"2026-11-29T21:17:01.990Z","severity":{"scorer":"zephyr","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"},"severities":[{"scorer":"zephyr","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"type":"semver","introduced":"4.4.0","fixed":"4.5.0","status":"affected"}],"vendor":"zephyrproject","product":"zephyr","package":"zephyr","source":"cvelist"}],"references":[{"url":"https://github.com/zephyrproject-rtos/zephyr/commit/4e42cd021b1b41e4d80cf56839432adb8360fe88","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-wjc6-4j74-9wrh","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"zephyr","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-105415","url":"https://www.cve.org/CVERecord?id=CVE-2026-105415","licence":"CVE Terms of Use","modified":"2026-11-29T20:56:53.074Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-105415","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-105415","licence":"Public domain","modified":"2026-11-29T21:17:01.990Z"}],"updatedAt":"2026-11-29T21:17:33.037Z","epss":{"score":0.00178,"percentile":0.07714,"date":"2026-12-01T12:00:22.000Z"}}