Description
The NVS backend of the Zephyr settings subsystem (subsys/settings/src/settings_nvs.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 nvs_read(). Per its contract, nvs_read() returns the full stored entry length (wlk_ate.len), which can exceed the supplied buffer length — only MIN(len, stored_len) bytes are actually copied, but the return value may be much larger, bounded only by the NVS sector size. Three sites (settings_nvs_cache_match(), settings_nvs_load(), and settings_nvs_save()) 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 SETTINGS_MAX_NAME_LEN. 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 settings_load() runs at boot or subsystem init, or during settings_save().

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 nvs_read() length is greater than or equal to the buffer size before performing the NUL store.
Published: 2026-08-19
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

An out‑of‑bounds write occurs when the Zephyr settings subsystem reads a stored setting name into a 74‑byte stack buffer and writes a terminating NUL byte at the index returned by nvs_read(). Because nvs_read() can return a value larger than the buffer, a crafted entry exceeding the buffer length will cause the NUL byte to be written past the end of the stack frame. The effect is a single byte overflow that can corrupt adjacent stack data and lead to a crash or denial of service. The flaw does not provide an attacker with code execution or confidentiality loss. It is formally classified as CWE‑787, Out‑of‑Bounds Write.

Affected Systems

The vulnerability exists in the Zephyr real‑time operating system, specifically in the settings NVS backend located in subsys/settings/src/settings_nvs.c. The flaw affects any device running a Zephyr build that includes the settings subsystem and has a settings partition backed by flash, regardless of the specific Zephyr version, as no version is currently known to contain the fix.

Risk and Exploitability

The CVSS score of 5.3 indicates moderate severity. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, reducing its prominence among actively exploited weaknesses. Exploitation requires an actor with write access to the flash partition used for settings—either a co‑resident or untrusted component, a malicious firmware image, or offline physical access to the device. This limits the attack surface and makes remote network attacks infeasible. If the attacker can inject a malformed entry, the exploit will trigger during boot or when the settings subsystem is initialized, causing a crash rather than reliable code execution.

Generated by OpenCVE AI on August 20, 2026 at 08:05 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the patch available in the referenced Zephyr commit or upgrade the Zephyr installation to a release that incorporates the fix.
  • Restrict write access to the settings partition, ensuring only trusted firmware or components can modify flash in that area.
  • If maintaining a custom build, implement defensive checks to skip any settings entry whose stored length is greater than or equal to the buffer size before attempting to terminate it with a NUL byte.

Generated by OpenCVE AI on August 20, 2026 at 08:05 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 21 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 20 Aug 2026 01:15:00 +0000

Type Values Removed Values Added
First Time appeared Zephyrproject
Zephyrproject zephyr
Vendors & Products Zephyrproject
Zephyrproject zephyr

Wed, 19 Aug 2026 21:00:00 +0000

Type Values Removed Values Added
Description The NVS backend of the Zephyr settings subsystem (subsys/settings/src/settings_nvs.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 nvs_read(). Per its contract, nvs_read() returns the full stored entry length (wlk_ate.len), which can exceed the supplied buffer length — only MIN(len, stored_len) bytes are actually copied, but the return value may be much larger, bounded only by the NVS sector size. Three sites (settings_nvs_cache_match(), settings_nvs_load(), and settings_nvs_save()) 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 SETTINGS_MAX_NAME_LEN. 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 settings_load() runs at boot or subsystem init, or during settings_save(). 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 nvs_read() length is greater than or equal to the buffer size before performing the NUL store.
Title Out-of-bounds stack write in the settings NVS backend from over-reported nvs_read length
Weaknesses CWE-787
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H'}


Subscriptions

Zephyrproject Zephyr
cve-icon MITRE

Status: PUBLISHED

Assigner: zephyr

Published:

Updated: 2026-08-20T15:26:33.463Z

Reserved: 2026-06-18T15:22:31.233Z

Link: CVE-2026-12634

cve-icon Vulnrichment

Updated: 2026-08-20T15:25:07.996Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-08-19T21:16:53.757

Modified: 2026-08-26T16:59:23.267

Link: CVE-2026-12634

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-20T08:15:17Z

Weaknesses