CVE-2026-12634: Out-of-bounds stack write in the settings NVS backend from over-reported nvs_read length

Published Aug 19, 2026
·
Updated

The NVS backend of the Zephyr settings subsystem (subsys/settings/src/settingsnvs.c) reads stored setting-name entries into fixed 74-byte stack buffers and NUL-terminates them with buf[rc] = '\0', where rc is the return value of nvsread(). Per its contract, nvsread() returns the full stored entry length (wlkate.len), which can exceed the supplied buffer length — only MIN(len, storedlen) bytes are actually copied, but the return value may be much larger, bounded only by the NVS sector size. Three sites (settingsnvscachematch(), settingsnvsload(), and settingsnvssave()) used this value directly as the NUL index without clamping, so an oversized stored name entry causes a single \0 byte to be written past the end of the stack buffer at an attacker-influenced offset (CWE-787).

The oversized entry cannot arise through the normal settings API, where names are bounded by SETTINGSMAXNAMELEN. It requires an actor able to write the flash that backs the settings partition — a co-resident or untrusted component sharing the flash device, a malicious settings image/restore, or offline/physical flash access (a shared-flash threat model). The malformed entry is parsed when settingsload() runs at boot or subsystem init, or during settingssave().

The out-of-bounds write is a single NUL byte at an offset equal to the crafted entry length (up to the NVS sector size), so the practical impact is a crash or denial of service and limited stack corruption rather than reliable code execution. There is no confidentiality impact, and the path is not reachable from the network through the ordinary settings interface. The fix skips any entry whose nvsread() length is greater than or equal to the buffer size before performing the NUL store.

Affected Software

1 affected component
Zephyr Zephyr settings subsystem

Event History

Aug 19, 2026
CVE Published
via MITRE·08:37 PM
Data Sourced
via MITRE·08:37 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Systems using the Zephyr settings NVS backend are exposed only under a shared-flash threat model: an actor must be able to write the flash backing the settings partition. Examples include a co-resident or untrusted component sharing the flash device, a malicious settings image or restore, or offline or physical flash access.

2

Can this be triggered through the normal settings API?

No. Normal settings API names are bounded by SETTINGS_MAX_NAME_LEN, so they cannot create the oversized stored name entry required to trigger the out-of-bounds write.

3

When is a malformed entry processed?

The malformed entry is processed when the settings NVS backend reads stored setting-name entries, including the affected cache-match, load, and save paths. An oversized stored length can cause the backend to NUL-terminate beyond its fixed 74-byte stack buffer.

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