CVE-2026-14368

Source
https://cve.org/CVERecord?id=CVE-2026-14368
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-14368.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-14368
Aliases
  • GHSA-vg53-h6qq-xx7h
Published
2026-08-31T18:45:07.165Z
Modified
2026-09-03T08:07:09.441949Z
Severity
  • 5.4 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L CVSS Calculator
Summary
Off-by-one out-of-bounds NUL write in Zephyr LwM2M JSON string parser
Details

The LwM2M JSON content formatter's getstring() in subsys/net/lib/lwm2m/lwm2mrwjson.c copies a parsed JSON string into a caller-supplied buffer and NUL-terminates it. The length guard used if (stringlength > 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: dowriteopjson() parses the payload obtained from coappacketgetpayload(), and getstring() is invoked from lwm2mwritehandler() (enginegetstring() in subsys/net/lib/lwm2m/lwm2mmessagehandling.c) for a LWM2MRESTYPESTRING resource. The destination buf/buflen is either the resource instance's fixed data buffer (resinst->dataptr/maxdatalen) 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 stringlength >= buflen, rejecting the exact-length case and aligning the JSON formatter with the other content formatters (lwm2mrwplaintext.c, lwm2mrwomatlv.c, lwm2mrwsenmljson.c, lwm2mrwcbor.c, lwm2mrwsenml_cbor.c), which already used the correct boundary check.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/14xxx/CVE-2026-14368.json",
    "cna_assigner": "zephyr",
    "cwe_ids": [
        "CWE-193",
        "CWE-787"
    ]
}
References

Affected packages

Git / github.com/zephyrproject-rtos/zephyr

Affected ranges

Type
GIT
Repo
https://github.com/zephyrproject-rtos/zephyr
Events
Database specific
Show details
{
    "source": [
        "AFFECTED_FIELD",
        "REFERENCES"
    ],
    "extracted_events": [
        {
            "introduced": "3.2.0"
        },
        {
            "fixed": "4.4.2"
        }
    ]
}

Affected versions

v3.*
v3.2.0
v3.3.0
v3.3.0-rc1
v3.3.0-rc2
v3.3.0-rc3
v3.4.0
v3.4.0-rc1
v3.4.0-rc2
v3.4.0-rc3
v3.5.0
v3.5.0-rc1
v3.5.0-rc2
v3.5.0-rc3
v3.6.0
v3.6.0-rc1
v3.6.0-rc2
v3.6.0-rc3
v3.7.0
v3.7.0-rc1
v3.7.0-rc2
v3.7.0-rc3
v4.*
v4.0.0
v4.0.0-rc1
v4.0.0-rc2
v4.0.0-rc3
v4.1.0
v4.1.0-rc1
v4.1.0-rc2
v4.1.0-rc3
v4.2.0
v4.2.0-rc1
v4.2.0-rc2
v4.2.0-rc3
v4.3.0
v4.3.0-rc1
v4.3.0-rc2
v4.3.0-rc3
v4.4.0
v4.4.0-rc1
v4.4.0-rc2
v4.4.0-rc3
zephyr-v3.*
zephyr-v3.2.0
zephyr-v3.3.0
zephyr-v3.4.0
zephyr-v3.5.0

Database specific

vanir_signatures
[
    {
        "signature_type": "Function",
        "deprecated": false,
        "digest": {
            "length": 461.0,
            "function_hash": "304775065609648517172219991152491603406"
        },
        "id": "CVE-2026-14368-3c11c68c",
        "target": {
            "function": "get_string",
            "file": "subsys/net/lib/lwm2m/lwm2m_rw_json.c"
        },
        "source": "https://github.com/zephyrproject-rtos/zephyr/commit/ba38f4b94337cc2c2446277ac181bdb5fec8f2b2",
        "signature_version": "v1"
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "digest": {
            "line_hashes": [
                "99420857371192069713749160352421171150",
                "299730730210946434571206491385632566257",
                "120382276868495596674885443704649623765",
                "253605995969652812107036360676777862945"
            ],
            "threshold": 0.9
        },
        "id": "CVE-2026-14368-69a02665",
        "target": {
            "file": "subsys/net/lib/lwm2m/lwm2m_rw_json.c"
        },
        "source": "https://github.com/zephyrproject-rtos/zephyr/commit/ba38f4b94337cc2c2446277ac181bdb5fec8f2b2",
        "signature_version": "v1"
    }
]
source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-14368.json"
vanir_signatures_modified
"2026-09-03T08:07:09Z"