Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H
C:N because vendor explicitly confirms over-read data is not reflected to the peer; I:L for the stray NUL stack write; AV:N and PR:N because the attack originates from the remote OCPP central server.
Primary rating from Vendor (zephyr).
CVSS VectorNVD
Lifecycle Timeline
6DescriptionNVD
The OCPP 1.6 client in subsys/net/lib/ocpp parsed inbound WAMP RPC frames in parse_rpc_msg() (subsys/net/lib/ocpp/ocpp_j.c) using a hand-rolled helper, extract_string_field(), that copied the message's uid and action fields with strncpy(out_buf, token + 1, outlen - 1) and then scanned the result with strchr(out_buf, '"'). Because strncpy does not NUL-terminate the destination when the source is at least outlen - 1 (127) bytes long, the subsequent strchr reads past the 128-byte destination buffer into adjacent stack memory; if a " byte is found beyond the buffer, a one-byte out-of-bounds NUL write also occurs. A related defect in extract_payload() runs strchr/strrchr over the receive buffer, which may not be NUL-terminated when a maximal-length frame fills it.
The parsed bytes come directly from the OCPP central-system server over a websocket: the reader thread fills recv_buf via websocket_recv_msg() and calls parse_rpc_msg() on each inbound DATA frame (subsys/net/lib/ocpp/ocpp.c). A malicious or compromised central server, or an on-path attacker (OCPP is commonly deployed over plain ws://), can send an RPC frame whose uid or action field is 127+ bytes with no closing quote, triggering the out-of-bounds access.
The primary impact is a remotely triggerable denial of service: the unbounded scan can fault on an unmapped page, and the stray NUL write can corrupt adjacent stack state. The over-read data is not reflected to the peer, so disclosure is limited. The feature is EXPERIMENTAL and must be explicitly enabled (CONFIG_OCPP). The fix replaces the manual parser with the bounds-respecting json_mixed_arr_parse() and copies the extracted uid with an explicitly NUL-terminated buffer, eliminating both over-reads.
AnalysisAI
Stack buffer over-read and stray one-byte NUL write in Zephyr RTOS's experimental OCPP 1.6 client allow a malicious or compromised OCPP central server - or an on-path attacker exploiting the commonly unencrypted ws:// transport - to crash a connected embedded device by sending a crafted WAMP RPC frame with an oversized uid or action field. The vulnerable helper extract_string_field() uses strncpy() without guaranteeing NUL-termination, causing a subsequent strchr() call to scan unbounded into adjacent stack memory; a secondary defect in extract_payload() compounds this on maximal-length frames. No active exploitation has been confirmed by CISA KEV, but SSVC classification indicates publicly available proof-of-concept code, and EPSS sits at a low 0.19% (10th percentile), consistent with a niche embedded RTOS attack surface.
Technical ContextAI
The vulnerability originates in the OCPP 1.6 (Open Charge Point Protocol) WebSocket JSON client within Zephyr's networking subsystem at subsys/net/lib/ocpp/ocpp_j.c. OCPP 1.6 encodes RPC messages as WAMP (Web Application Messaging Protocol) arrays over WebSocket, and the Zephyr implementation parses these in parse_rpc_msg(). CWE-125 (Out-of-bounds Read) maps precisely to the root cause: extract_string_field() calls strncpy(out_buf, token + 1, outlen - 1) with outlen=128, copying at most 127 bytes but never writing the NUL terminator when the source string is exactly 127 or more bytes - a well-documented C pitfall. The immediately following strchr(out_buf, '"') then walks unbounded into adjacent stack frames; if a double-quote byte is found beyond the 128-byte boundary, a one-byte NUL is written at that out-of-bounds address, potentially corrupting a saved return address, local variable, or canary. A secondary defect in extract_payload() calls strchr/strrchr on recv_buf, which may be unterminated when a maximal-length OCPP frame exactly fills the buffer. The commit diff confirms the fix replaces both helpers with the bounds-safe json_mixed_arr_parse() API and explicitly NUL-terminates the uid copy with uid[uidlen-1]='\0'. The affected CPE is cpe:2.3:a:zephyrproject:zephyr:*:*:*:*:*:*:*:*, covering versions 4.3.0 through pre-4.5.0 on all supported architectures, but only when CONFIG_OCPP=y is set at build time.
RemediationAI
Upgrade to Zephyr 4.5.0 or later, which incorporates the fix from commit e500f7b81b5b8a867e28b2f4e59512cbfdd5ae75 (https://github.com/zephyrproject-rtos/zephyr/commit/e500f7b81b5b8a867e28b2f4e59512cbfdd5ae75); the patched version is confirmed by the upstream Zephyr project security advisory at GHSA-jgqq-7mjj-w642. If an immediate firmware rebuild and deployment is not feasible, the most effective compensating control is to disable CONFIG_OCPP at build time and re-flash, which eliminates the vulnerable code entirely with no functional impact on non-OCPP workloads. For operators who require OCPP functionality and cannot patch immediately, two network-layer mitigations reduce (but do not eliminate) risk: first, configure the OCPP WebSocket connection to use TLS (wss://) with certificate pinning to the legitimate central server, which defeats on-path injection attacks though not a compromised server; second, isolate the device's network segment so the OCPP central server endpoint is reachable only from a trusted management VLAN, reducing the on-path attacker surface. Note that neither network-layer measure addresses the case of a legitimately compromised central server, so patching remains the only complete fix.
Potential off-by-one buffer overflow vulnerability in the Zephyr fuse file system. Rated critical severity (CVSS 10.0),
Possible variant of CVE-2021-3434 in function le_ecred_reconf_req. Rated critical severity (CVSS 9.8), this vulnerabilit
Unchecked user input length in /subsys/net/l2/wifi/wifi_shell.c can cause buffer overflows. Rated critical severity (CVS
Potential buffer overflow vulnerability in the Zephyr CAN bus subsystem. Rated critical severity (CVSS 9.8), this vulner
Integer Underflow in 6LoWPAN IPHC Header Uncompression in Zephyr. Rated critical severity (CVSS 9.8), this vulnerability
Buffer overflow in Zephyr USB DFU DNLOAD. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable
DOS: Incorrect 802154 Frame Validation for Omitted Source / Dest Addresses. Rated critical severity (CVSS 9.8), this vul
zephyr-rtos version 1.12.0 contains a NULL base pointer reference vulnerability in sys_ring_buf_put(), sys_ring_buf_get(
Potential buffer overflow vulnerabilities n the Zephyr Bluetooth subsystem. Rated critical severity (CVSS 9.6), this vul
Buffer overflow in Zephyr RTOS dns_unpack_name() function causing OOB writes. PoC available.
The documentation specifies that the BT_GATT_PERM_READ_LESC and BT_GATT_PERM_WRITE_LESC defines for a Bluetooth characte
Potential buffer overflows in the Bluetooth subsystem due to asserts being disabled in /subsys/bluetooth/host/hci_core.c
Same weakness CWE-125 – Out-of-bounds Read
View allSame technique Buffer Overflow
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-52008