CVE-2026-102950: ZMS mount recovery treats stored value data as allocation table entries, allowing forged entries and storage corruption
The mount-time recovery scan of the Zephyr Memory Storage (ZMS) key-value store, zmsrecoverlastate() in subsys/kvss/zms/zms.c (subsys/fs/zms/zms.c in older releases), computes the end of the sector's data area incorrectly. Every valid allocation table entry (ATE) reset the data-end bound to the start of the sector, including entries whose value is stored inline (8 bytes or less) and delete entries. When the newest ATE in the active sector is one of these, the scan continues past the ATE area into the payload area and reads stored value bytes as struct zmsate records.
Any payload slot that passes the ATE check (a CRC8 plus the one-byte sector cycle count) is adopted as the newest entry. zmsinit() then sets fs->atewra and fs->datawra from it. The pointers are only this weak check away from data an application may have stored on behalf of a remote party: a BLE-writable device name, provisioned credentials, or configuration received over the network. An attacker who can get about 16 bytes of chosen content persisted in a ZMS value can plant a forged ATE. The forged entry takes effect after the next mount, provided the newest entry in that sector is small or a delete. Random data can also match by chance, which is how the issue was found.
A forged or accidentally matched ATE overrides the stored entry for any chosen id. Its inline data or its offset/len pointer controls what later reads of that key return. The misplaced write pointers also make later writes place ATEs and payloads over other entries' existing data, silently corrupting persistent configuration such as settings values stored in ZMS. The effects are limited to the active flash sector and to what ZMS returns to its callers. No RAM out-of-bounds access was identified.
Affected Software
Event History
Frequently Asked Questions
Who is realistically exposed to exploitation?
Devices that use ZMS and persist attacker-influenced values are exposed, particularly where remote parties can set BLE device names, provision credentials, or submit network-delivered configuration. Exploitation also depends on the affected sector's newest entry being an inline value of 8 bytes or less or a delete entry.
What must an attacker do to trigger the corruption?
An attacker needs to cause roughly 16 bytes of chosen content to be persisted in a ZMS value. That content must be crafted so that, when interpreted as an allocation table entry during the next mount, it passes the CRC8 and one-byte sector cycle-count checks.
Does the forged entry take effect immediately?
No. The forged entry is adopted during the next mount-time recovery scan, after which zms_init() uses it to set the allocation-table and data write pointers. The resulting pointer corruption can cause storage corruption.
How can teams assess whether their configuration is at risk?
Review whether the device uses ZMS and whether untrusted or remotely controlled input can be stored as ZMS values. Also determine whether an active sector can have a small inline value or delete as its newest entry before a remount.