CVE-2026-14368
Received Received - Intake

Buffer Overflow in Zephyr RTOS LwM2M JSON Formatter

Vulnerability report for CVE-2026-14368, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-31

Last updated on: 2026-08-31

Assigner: Zephyr Project

Description

The LwM2M JSON content formatter's get_string() in subsys/net/lib/lwm2m/lwm2m_rw_json.c copies a parsed JSON string into a caller-supplied buffer and NUL-terminates it. The length guard used if (string_length > buflen), which accepts a string whose length is exactly buflen. After memcpy() fills the whole buffer, buf[string_length] = '\0' then writes one byte past the end of the buffer (CWE-787). The string value and its length are taken directly from the incoming CoAP payload during a LwM2M WRITE: do_write_op_json() parses the payload obtained from coap_packet_get_payload(), and get_string() is invoked from lwm2m_write_handler() (engine_get_string() in subsys/net/lib/lwm2m/lwm2m_message_handling.c) for a LWM2M_RES_TYPE_STRING resource. The destination buf/buflen is either the resource instance's fixed data buffer (res_inst->data_ptr/max_data_len) or the engine validation buffer (msg->ctx->validate_buf). A LwM2M server (the client's DTLS peer) can therefore write a string resource with a value whose length equals the target buffer size and force a one-byte overflow. The overflow is a single out-of-bounds write of the constant byte 0x00 immediately past the resource or validation buffer, corrupting the adjacent byte in memory. It is not an information leak and the written value is fixed, so it is not a direct code-execution primitive, but it can corrupt adjacent state (an adjacent resource value, a length/flag field, or a struct field) and cause data corruption or a crash. Triggering the write is deterministic; the resulting impact depends on memory layout. The fix changes the guard to string_length >= buflen, rejecting the exact-length case and aligning the JSON formatter with the other content formatters (lwm2m_rw_plain_text.c, lwm2m_rw_oma_tlv.c, lwm2m_rw_senml_json.c, lwm2m_rw_cbor.c, lwm2m_rw_senml_cbor.c), which already used the correct boundary check.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-31
Last Modified
2026-08-31
Generated
2026-08-31
AI Q&A
2026-08-31
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
zephyrproject zephyr to 4.4.2 (exc)
zephyrproject zephyr From 3.2.0 (inc) to 4.4.2 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-193 A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is an off-by-one error in the LwM2M JSON content formatter's get_string() function in Zephyr RTOS. It allows a string of exactly the buffer length to pass a length check, causing a one-byte buffer overflow when appending a null terminator. This corrupts adjacent memory and may lead to crashes or data corruption.

Detection Guidance

To detect this vulnerability, check if your Zephyr RTOS system is running a vulnerable version (3.2.0 to 4.4.1) with LwM2M JSON support enabled. Inspect the LwM2M client logs for crashes or memory corruption during string resource writes. Use network monitoring tools to observe malformed CoAP payloads sent to LwM2M servers.

Impact Analysis

An attacker could exploit this by sending a crafted string payload to a vulnerable LwM2M client, causing memory corruption. This may result in crashes, incorrect behavior, or potential denial of service. The impact depends on memory layout and what data is adjacent to the buffer.

Compliance Impact

This vulnerability could potentially affect compliance with GDPR and HIPAA by enabling memory corruption through a buffer overflow. This may lead to data integrity issues or system crashes, which could compromise the confidentiality, integrity, or availability of sensitive data processed by the affected LwM2M client in Zephyr RTOS.

Mitigation Strategies

Upgrade Zephyr RTOS to version 4.4.2 or later to apply the fix. Disable LwM2M JSON support if not required by setting CONFIG_LWM2M_RW_JSON_SUPPORT=n. Restrict network access to LwM2M servers to trusted entities only.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-14368. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart