{"id":"CVE-2026-82961","revision":null,"records":[{"revision":"933d8717e4964f8d8cb76622c78d8e91","observedAt":"2026-10-28T17:46:48.824+00:00","statement":{"source":"cve-program","id":"CVE-2026-82961","aliases":[],"title":"Unvalidated pin index in GPIO syscall handlers allows out-of-bounds kernel writes from user mode","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.\n\nGPIO 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.\n\nThe 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.\n\nThe 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.","state":0,"publishedAt":"2026-10-28T16:58:58.927+00:00","modifiedAt":"2026-10-28T16:58:58.927+00:00","affected":[{"ecosystem":"https://github.com/zephyrproject-rtos/zephyr","name":"zephyr","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"zephyrproject\",\n                    \"product\": \"zephyr\",\n                    \"collectionURL\": \"https://github.com/zephyrproject-rtos/zephyr\",\n                    \"packageName\": \"zephyr\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"programFiles\": [\n                        \"drivers/gpio/gpio_emul.c\",\n                        \"drivers/gpio/gpio_handlers.c\",\n                        \"include/drivers/gpio.h\",\n                        \"include/zephyr/drivers/gpio.h\"\n                    ],\n                    \"programRoutines\": [\n                        {\n                            \"name\": \"z_vrfy_gpio_config\"\n                        },\n                        {\n                            \"name\": \"z_vrfy_gpio_pin_configure\"\n                        },\n                        {\n                            \"name\": \"z_vrfy_gpio_pin_get_config\"\n                        },\n                        {\n                            \"name\": \"z_vrfy_gpio_pin_interrupt_configure\"\n                        }\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"2.2.0\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"semver\",\n                            \"lessThanOrEqual\": \"4.4.2\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"severity":"HIGH"}],"references":["https://github.com/zephyrproject-rtos/zephyr/commit/020e83e06b35e98a4a3c2354f67e5eee3f163363","https://github.com/zephyrproject-rtos/zephyr/commit/d145faab7e3a8cea62a8fd7ed5f30ef73e762f59","https://github.com/zephyrproject-rtos/zephyr/commit/c9641fa5bfec44892e0cf2d84f78c7c60fca8ad6","https://github.com/zephyrproject-rtos/zephyr/commit/d28a05d5de4420f27ba3de7b9e4442fa056d51de","https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-4f2x-8qw8-jjgf"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-82961","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-82961","identifiers":["CVE-2026-82961"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-31T00:45:27.0287685+00:00","complete":true,"records":1766,"lastAttemptAt":"2026-10-31T00:45:27.0287685+00:00","lastSuccessAt":"2026-10-31T00:45:27.1820559+00:00","error":null,"lastVerifiedAt":"2026-10-31T00:45:27.1820567+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-7e2c4e7288f2c464ad8c61f3bb6017374714faedcc781283ac06a706ee1a820b-2ab14bbac7aed146eb4566d0c0f2f6122020a00e6e03e98c548f6ca78b564d0c","complete":true,"records":417480,"lastAttemptAt":"2026-10-31T01:45:32.282049+00:00","lastSuccessAt":"2026-10-30T23:45:37.8421483+00:00","error":null,"lastVerifiedAt":"2026-10-30T23:45:38.1384309+00:00","snapshotPublishedAt":"2026-10-30T23:26:20+00:00","importing":true,"stagedRecords":357500,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-39149994e3854f27b5e713b62480af55","complete":true,"records":13563,"lastAttemptAt":"2026-10-31T00:45:56.6248575+00:00","lastSuccessAt":"2026-10-31T00:45:56.62+00:00","error":null,"lastVerifiedAt":"2026-10-31T00:45:56.62+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13635,"expectedIdentifiers":13635,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-31T00:45:27.0287685+00:00","complete":true,"records":1094,"lastAttemptAt":"2026-10-31T00:45:27.0287685+00:00","lastSuccessAt":"2026-10-31T00:45:27.1829931+00:00","error":null,"lastVerifiedAt":"2026-10-31T00:45:27.1829933+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-01dfb738868f495991dd71b57183de53","complete":false,"records":13575,"lastAttemptAt":"2026-10-31T00:45:54.6049966+00:00","lastSuccessAt":"2026-10-31T00:45:54.602+00:00","error":null,"lastVerifiedAt":"2026-10-31T00:45:54.602+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13599,"expectedIdentifiers":13635,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-21dcd6662970dfea02e4ea60ee637115e8d92664947484d2b9276b3f6568a84f","complete":true,"records":9815,"lastAttemptAt":"2026-10-31T00:45:26.9752288+00:00","lastSuccessAt":"2026-10-30T23:47:34.1817587+00:00","error":null,"lastVerifiedAt":"2026-10-31T00:45:26.9752288+00:00","snapshotPublishedAt":"2026-10-30T23:33:17+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-10-31T00:45:26.4902262+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-10-31T00:45:26.4902262+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-f95f76cd406ae5bae3de632ad37fd2d5160b44f5e6b51748ac6f8f0c0c88e72b","complete":true,"records":3028,"lastAttemptAt":"2026-10-31T00:45:26.9885441+00:00","lastSuccessAt":"2026-10-30T23:47:38.4914494+00:00","error":null,"lastVerifiedAt":"2026-10-31T00:45:26.9885441+00:00","snapshotPublishedAt":"2026-10-30T23:18:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-3bba47d78eb61bae29443e8f4fe215a6614d54f3560d07419145a76e9ac024ad","complete":true,"records":230992,"lastAttemptAt":"2026-10-31T00:45:26.8701271+00:00","lastSuccessAt":"2026-10-30T23:47:24.2343384+00:00","error":null,"lastVerifiedAt":"2026-10-31T00:45:26.8701271+00:00","snapshotPublishedAt":"2026-10-30T23:18:17+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}