---
id: CVE-2026-13217
title: >-
  NULL-pointer dereference in Zephyr OCPP CALLRESULT parsing via unchecked
  strtok_r/atoi
summary: >-
  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
  ocpp_process_server_msg() the code calls atoi(strtok_r(uid, "-", &tmp))
  without checking the strtok…
severity: medium
cvss: 5.9
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'
cvssSource: cna
cwe:
  - CWE-476
vendor: zephyrproject
product: zephyr
affected:
  - zephyr >= 4.3.0 < 4.3.2
  - zephyr >= 4.4.0 < 4.4.2
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-08-25T19:40:23.470690Z'
published: '2026-08-25'
updated: '2026-11-04'
sourceUpdated: '2026-11-04T04:59:46.392Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-13217'
references:
  - url: >-
      https://github.com/zephyrproject-rtos/zephyr/commit/4d8a9eb1448061ccee557ef20a2a58aec91d9cad
    label: Fix commit 4d8a9eb14480
  - url: >-
      https://github.com/zephyrproject-rtos/zephyr/commit/eba36f8ed63a055ed862ab2b4bb801b6dce07bb7
    label: Fix commit eba36f8ed63a
  - url: >-
      https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-w234-pcxp-4q8r
    label: GHSA-w234-pcxp-4q8r
tags:
  - cve.org
epss: 0.00667
epssPercentile: 0.5205
ingestedAt: '2026-11-05T20:33:06.707Z'
---

## Overview

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 ocpp_process_server_msg() the code calls atoi(strtok_r(uid, "-", &tmp)) without checking the strtok_r return value. When the server-supplied uid is empty or contains no - delimiter, strtok_r() returns NULL and atoi(NULL) dereferences a NULL pointer, which is undefined behaviour.

The uid originates from network data: parse_rpc_msg() in subsys/net/lib/ocpp/ocpp_j.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 ocpp_session_is_valid(), 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 CONFIG_NULL_POINTER_EXCEPTION_DETECTION), 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.

## Affected

- `zephyr >= 4.3.0 < 4.3.2`
- `zephyr >= 4.4.0 < 4.4.2`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
