# CVE-2026-14368: Off-by-one out-of-bounds NUL write in Zephyr LwM2M JSON string parser

> A remote attacker can trigger a one-byte out-of-bounds write in the Zephyr LwM2M JSON parser, potentially causing crashes or data corruption.

- **Severity:** Medium 5.4 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 31 Aug 2026
- **Updated:** 1 Sep 2026
- **Also known as:** GHSA-vg53-h6qq-xx7h

## What is CVE-2026-14368?

CVE-2026-14368 is a medium-severity memory corruption vulnerability in zephyrproject zephyr, published on 31 Aug 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official 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.

Weakness: CWE-787 (Out-of-bounds Write), CWE-193 (Off-by-one Error)

## Which versions are affected by CVE-2026-14368?


## How do I fix CVE-2026-14368?

No fix has been published for CVE-2026-14368 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-14368 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-14368 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-14368 and fix it if it is affected.

What it is: CVE-2026-14368 is a medium-severity memory corruption vulnerability in zephyrproject zephyr, published on 31 Aug 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-14368 exists.

Affected product: zephyrproject zephyr. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-14368/ (Markdown: https://insights.sbomify.com/CVE-2026-14368/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-14368
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-14368
- OSV: https://osv.dev/vulnerability/CVE-2026-14368

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-14368/
Summaries are generated and may contain mistakes; the official description above is the record.
