Description
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.
Published: 2026-08-25
Score: 5.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Remote Denial of Service
Action: Immediate Patch
AI Analysis

Impact

The vulnerability resides in the Zephyr OCPP 1.6 client, where an unvalidated call to strtok_r followed by atoi dereferences a NULL pointer if the server‑supplied uid is malformed. The defect is partially repaired in commit 4d8a9eb by guarding the first atoi, but the subsequent strtok_r(NULL, "-", &tmp) followed by pdu = atoi(buf) remains unchecked, so a uid containing a first token but no second token still triggers a NULL dereference. The resulting undefined behaviour causes a fault in the OCPP reader thread, leading to a system crash on platforms that trap accesses to address zero. The impact is limited to availability, producing a remote denial of service on affected Zephyr targets and is platform conditional.

Affected Systems

All Zephyr RTOS builds that include the OCPP 1.6 client prior to the application of the fix in commit 4d8a9eb1448061ccee557ef20a2a58aec91d9cad. The vulnerability affects any device that uses the default OCPP client module without a patched source, regardless of the specific version number, because no version information is provided in the advisory.

Risk and Exploitability

The CVSS score of 5.9 indicates a moderate severity and the EPSS score is not available. The defect is not listed in CISA’s KEV catalog. An attacker can trigger the fault by sending a malformed uid string over an untrusted or man‑in‑the‑middle WebSocket connection to the charge point, without requiring authentication. The exploit requires only network access to the OCPP server, making the risk base attack vector network. While the vulnerability exploited is a null‑pointer dereference (CWE‑476), the lack of strong input validation makes it relatively easy to deliver a malformed uid. The exploit does not provide arbitrary code execution; it merely causes a denial of service on platforms that fault on null dereference. The defect can also be triggered by a uid that contains a first token but no second token after the delimiter, owing to the second strtok_r call being unchecked.

Generated by OpenCVE AI on August 25, 2026 at 21:08 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the Zephyr patch from commit 4d8a9eb1448061ccee557ef20a2a58aec91d9cad, which also validates the second token, or upgrade to a Zephyr release that contains a complete fix for this defect.
  • Rebuild and deploy the updated Zephyr firmware to all devices that use the OCPP 1.6 client.
  • Configure the OCPP client to use secure WebSocket (wss://) connections or otherwise prevent man‑in‑the‑middle attacks, because the exploit relies on a server‑supplied malformed uid.

Generated by OpenCVE AI on August 25, 2026 at 21:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 25 Aug 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 25 Aug 2026 17:45:00 +0000

Type Values Removed Values Added
First Time appeared Zephyrproject
Zephyrproject zephyr
Vendors & Products Zephyrproject
Zephyrproject zephyr

Tue, 25 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Description 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.
Title NULL-pointer dereference in Zephyr OCPP CALLRESULT parsing via unchecked strtok_r/atoi
Weaknesses CWE-476
References
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'}


Subscriptions

Zephyrproject Zephyr
cve-icon MITRE

Status: PUBLISHED

Assigner: zephyr

Published:

Updated: 2026-08-25T19:40:42.354Z

Reserved: 2026-06-24T15:29:26.668Z

Link: CVE-2026-13217

cve-icon Vulnrichment

Updated: 2026-08-25T19:40:31.713Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-08-25T17:17:05.163

Modified: 2026-08-26T16:59:23.267

Link: CVE-2026-13217

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-25T21:15:13Z

Weaknesses