CVE-2026-13217

Source
https://cve.org/CVERecord?id=CVE-2026-13217
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-13217.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-13217
Aliases
  • GHSA-w234-pcxp-4q8r
Published
2026-08-25T16:05:38.128Z
Modified
2026-08-28T14:33:02.222273Z
Severity
  • 5.9 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
NULL-pointer dereference in Zephyr OCPP CALLRESULT parsing via unchecked strtok_r/atoi
Details

The OCPP 1.6 client in subsys/net/lib/ocpp/ocpp.c reconstructs a session handle and PDU id from the uid field of a CALLRESULT message. In ocppprocessservermsg() the code calls atoi(strtokr(uid, "-", &tmp)) without checking the strtokr return value. When the server-supplied uid is empty or contains no - delimiter, strtokr() returns NULL and atoi(NULL) dereferences a NULL pointer, which is undefined behaviour.

The uid originates from network data: parserpcmsg() in subsys/net/lib/ocpp/ocppj.c JSON-parses a frame received from the OCPP central system over TCP/WebSocket and copies the server-controlled string into the local buffer. A malicious or compromised central system, or a man-in-the-middle on a non-TLS ws:// connection, can return a malformed uid to reach the defect. No authentication beyond the existing server connection (or MITM position) is required, and the reconstructed pointer is membership-validated by ocppsessionisvalid(), so the impact is limited to the NULL dereference rather than arbitrary pointer use.

On Zephyr targets that trap access to address 0 (MMU/MPU platforms or CONFIGNULLPOINTEREXCEPTIONDETECTION), the dereference faults inside the OCPP reader thread and invokes the fatal handler, producing a remote denial of service of the charge point; on bare targets where address 0 is readable the call returns 0 and is benign, so the impact is availability-only and platform-conditional.

The applied fix guards only the first atoi(); the second strtok_r(NULL, "-", &tmp) followed by pdu = atoi(buf) in the same function remains unguarded and the identical NULL dereference is still reachable from the same network input when the uid has a first token but no second --delimited token. A complete fix should validate the second token as well.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/13xxx/CVE-2026-13217.json",
    "cwe_ids": [
        "CWE-476"
    ],
    "cna_assigner": "zephyr"
}
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": "4.3.0"
        },
        {
            "fixed": "4.4.2"
        }
    ]
}

Affected versions

v4.*
v4.3.0
v4.4.0
v4.4.0-rc1
v4.4.0-rc2
v4.4.0-rc3

Database specific

vanir_signatures
[
    {
        "id": "CVE-2026-13217-4c7d6a07",
        "target": {
            "file": "subsys/net/lib/ocpp/ocpp.c"
        },
        "deprecated": false,
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "229340375586850807061659680568544851927",
                "64582104775749143253322577667712423440",
                "33967856936578847747430538556898151005",
                "34653187361021109176327486033946330590"
            ]
        },
        "signature_version": "v1",
        "source": "https://github.com/zephyrproject-rtos/zephyr/commit/3a55507dd8011d877dc89eff949e70b42d45bacf",
        "signature_type": "Line"
    },
    {
        "id": "CVE-2026-13217-94f117a6",
        "target": {
            "function": "ocpp_process_server_msg",
            "file": "subsys/net/lib/ocpp/ocpp.c"
        },
        "deprecated": false,
        "digest": {
            "function_hash": "337637019550328805342545297644387687732",
            "length": 2849.0
        },
        "signature_version": "v1",
        "source": "https://github.com/zephyrproject-rtos/zephyr/commit/4d8a9eb1448061ccee557ef20a2a58aec91d9cad",
        "signature_type": "Function"
    },
    {
        "id": "CVE-2026-13217-cd0e56b3",
        "target": {
            "function": "ocpp_process_server_msg",
            "file": "subsys/net/lib/ocpp/ocpp.c"
        },
        "deprecated": false,
        "digest": {
            "function_hash": "83163821473894983937132030747381855649",
            "length": 2890.0
        },
        "signature_version": "v1",
        "source": "https://github.com/zephyrproject-rtos/zephyr/commit/3a55507dd8011d877dc89eff949e70b42d45bacf",
        "signature_type": "Function"
    },
    {
        "id": "CVE-2026-13217-e63aeb5f",
        "target": {
            "file": "subsys/net/lib/ocpp/ocpp.c"
        },
        "deprecated": false,
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "286132975026455062757246522182990937121",
                "28520618197110131816743575688616680943",
                "160042196479331764733102786265613726769",
                "276038884985380193072322743815093030144"
            ]
        },
        "signature_version": "v1",
        "source": "https://github.com/zephyrproject-rtos/zephyr/commit/4d8a9eb1448061ccee557ef20a2a58aec91d9cad",
        "signature_type": "Line"
    }
]
source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-13217.json"
vanir_signatures_modified
"2026-08-28T14:33:02Z"