Impact
A vulnerability in the Zephyr LwM2M JSON content formatter allows a write operation to copy a JSON string into a caller-supplied buffer and then NUL‑terminate it one byte past the buffer end. The guard accepts an input length equal to the buffer size, leading to an off‑by‑one out‑of‑bounds write of the constant byte 0x00. This does not give direct code execution but can corrupt adjacent memory, potentially corrupting resource values or internal state and causing a crash. The weakness is classified as CWE-193 (Off‑by‑One Error) and CWE-787 (Out‑of‑Bounds Write).
Affected Systems
The flaw resides in the Zephyr RTOS LwM2M implementation. All versions of Zephyr that include the vulnerable lwm2m_rw_json.c file before the fix are affected; no specific version range is listed, so any instance that exposes the LwM2M JSON content formatter to external writes is potentially vulnerable.
Risk and Exploitability
The CVSS score is 5.4, indicating a moderate impact. EPSS is not available and the vulnerability is not listed in CISA’s KEV catalog. An attacker can trigger the overflow by sending a LwM2M WRITE request with a string resource whose content length exactly matches the buffer size, and the LwM2M server (the client’s DTLS peer) can supply such a payload. The attack requires network access to the device’s CoAP interface and the ability to write to a string resource, making it a remote attack against devices with exposed LwM2M services. While the immediate effect is data corruption or denial of service, the deterministic nature of the trigger allows an attacker to reliably produce the effect once the conditions are met.
OpenCVE Enrichment