# CVE-2026-82961: Unvalidated pin index in GPIO syscall handlers allows out-of-bounds kernel writes from user mode

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.18% (percentile 5, 2026-11-28)
- **CWE:** CWE-787
- **Published:** 2026-10-28T16:58:58.927Z
- **Modified:** 2026-11-05T17:18:21.673Z

## Who should check

- Anyone running zephyrproject zephyr \>= 2.2.0, \< 4.5.0

## Description

The GPIO syscall handlers in drivers/gpio/gpio\_handlers.c did not validate the pin argument supplied by a user-mode caller. z\_vrfy\_gpio\_pin\_configure(), z\_vrfy\_gpio\_pin\_get\_config() and z\_vrfy\_gpio\_pin\_interrupt\_configure() verified only the device object (K\_SYSCALL\_DRIVER\_GPIO() / K\_SYSCALL\_OBJ()) and then passed the caller-supplied gpio\_pin\_t straight through to z\_impl\_gpio\_pin\_\*() and on to the driver. The only pin check in include/zephyr/drivers/gpio.h was \_\_ASSERT(gpio\_port\_pin\_is\_supported(cfg-\>port\_pin\_mask, pin), ...), which compiles to nothing unless CONFIG\_ASSERT is enabled, so in a production build no check existed at all.

GPIO drivers use pin as a shift count and as an array index on the documented assumption that it is a pin the controller supports. On STM32, for example, gpio\_stm32\_pin\_interrupt\_configure() turns pin into an EXTI line and stm32\_gpio\_intc\_set\_irq\_callback() writes data-\>cb\[line\_num\].cb and data-\>cb\[line\_num\].data into a NUM\_EXTI\_LINES-entry array (default 16) in drivers/interrupt\_controller/intc\_gpio\_stm32.c, guarded only by a compiled-out \_\_ASSERT\_NO\_MSG(); the same function then reads exti\_irq\_table\[line\_num\] and calls irq\_enable() on the result. Other controllers index fixed-size per-pin configuration tables the same way — drivers/gpio/gpio\_ite\_it8xxx2\_v2.c reads an MMIO base pointer out of wuc\_base\[8\] with the caller's pin and performs a read-modify-write through it.

The issue is reachable only in builds with CONFIG\_USERSPACE=y (the file is compiled under that symbol), by a user-mode thread that has been granted access to a GPIO device object. Such a grant is intended to authorize control of that port's pins; the missing validation instead lets the thread drive a supervisor-mode out-of-bounds write of a function pointer and an associated void \* past a kernel .bss array, and out-of-bounds reads that feed irq\_enable() and MMIO accesses — an escape from the user-mode sandbox that can lead to kernel memory corruption, arbitrary code execution, or a crash.

The fix validates pin against the controller's gpio\_driver\_config.port\_pin\_mask with gpio\_port\_pin\_is\_supported() in every pin-taking z\_vrfy\_ handler and returns -EINVAL otherwise, complemented by an unconditional pin \>= GPIO\_MAX\_PINS\_PER\_PORT range check added to the shared z\_impl\_gpio\_pin\_\*() inlines.

## Affected and fixed versions

- zephyrproject zephyr: \>= 2.2.0, \< 4.5.0 (cvelist)

## Mitigation

- Upgrade zephyr to 4.5.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-82961. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-82961.md
Affected: zephyrproject zephyr >= 2.2.0, < 4.5.0
Fixed in: zephyrproject zephyr 4.5.0

Steps:
1. Search this machine and project for zephyrproject zephyr: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-82961 being exploited?

There is no confirmed exploitation: CVE-2026-82961 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.18% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-82961?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-82961?

zephyrproject zephyr \>= 2.2.0, \< 4.5.0.

### Is there a fix for CVE-2026-82961?

Yes. Fixed in zephyrproject zephyr 4.5.0. Upgrade zephyr to 4.5.0 or later.

### How do I check if I'm affected by CVE-2026-82961?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-4f2x-8qw8-jjgf>
- patch: <https://github.com/zephyrproject-rtos/zephyr/commit/020e83e06b35e98a4a3c2354f67e5eee3f163363>
- patch: <https://github.com/zephyrproject-rtos/zephyr/commit/d145faab7e3a8cea62a8fd7ed5f30ef73e762f59>
- patch: <https://github.com/zephyrproject-rtos/zephyr/commit/c9641fa5bfec44892e0cf2d84f78c7c60fca8ad6>
- patch: <https://github.com/zephyrproject-rtos/zephyr/commit/d28a05d5de4420f27ba3de7b9e4442fa056d51de>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-82961>

HTML: <https://flawdb.com/CVE-2026-82961> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-82961>
