{"id":"CVE-2026-13214","aliases":["CVE-2026-13214"],"related":[],"kind":"vulnerability","state":"published","title":"Stack buffer overflow in OCPP GetConfiguration key parsing","summary":"The OCPP 1.6 client in subsys/net/lib/ocpp/ocpp_j.c contains a stack buffer overflow in parse_getconfig_msg(). When handling a GetConfiguration request from the central system, the handler copied the attacker-controlled JSON \"key\" string into the caller's fixed 50-byte stack buffer (skey[CISTR50], declared in subsys/net/lib/ocpp/ocpp.c) using an unbounded strcpy(). The parsed key value points directly into the receive buffer, so its length is bounded only by the message size (CONFIG_OCPP_RECV_BUFFER_SIZE, default 2048).\n\nThe GetConfiguration message is delivered over the WebSocket connection that the charge point opens to its configured central system. The reader thread ocpp_wsreader() reads the message into ui->recv_buf and dispatches it to parse_getconfig_msg() via the PDU function table. An attacker who controls the central system endpoint, or a man-in-the-middle on an unencrypted connection, can send a GetConfiguration request whose \"key\" field exceeds 50 bytes and overflow the reader thread's stack with attacker-chosen bytes.\n\nThe consequence is a remotely triggerable stack smash on the OCPP reader thread: at minimum a denial of service, and plausibly remote code execution depending on build-time hardening such as stack canaries and MPU configuration. The fix replaces the strcpy() with a bounded strncpy(key, payload.key[0], CISTR50 - 1) followed by explicit NUL termination, matching the bounded copies already used by the sibling handlers.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The OCPP 1.6 client in subsys/net/lib/ocpp/ocpp_j.c contains a stack buffer overflow in parse_getconfig_msg(). When handling a GetConfiguration request from the central system, the handler copied the attacker-controlled JSON \"key\" string into the caller's fixed 50-byte stack buffer (skey[CISTR50], declared in subsys/net/lib/ocpp/ocpp.c) using an unbounded strcpy(). The parsed key value points directly into the receive buffer, so its length is bounded only by the message size (CONFIG_OCPP_RECV_BUFFER_SIZE, default 2048).\n\nThe GetConfiguration message is delivered over the WebSocket connection that the charge point opens to its configured central system. The reader thread ocpp_wsreader() reads the message into ui->recv_buf and dispatches it to parse_getconfig_msg() via the PDU function table. An attacker who controls the central system endpoint, or a man-in-the-middle on an unencrypted connection, can send a GetConfiguration request whose \"key\" field exceeds 50 bytes and overflow the reader thread's stack with attacker-chosen bytes.\n\nThe consequence is a remotely triggerable stack smash on the OCPP reader thread: at minimum a denial of service, and plausibly remote code execution depending on build-time hardening such as stack canaries and MPU configuration. The fix replaces the strcpy() with a bounded strncpy(key, payload.key[0], CISTR50 - 1) followed by explicit NUL termination, matching the bounded copies already used by the sibling handlers.","source":"cvelist"},{"lang":"es","text":"El cliente OCPP 1.6 en subsys/net/lib/ocpp/ocpp_j.c contiene un desbordamiento de búfer de pila en parse_getconfig_msg(). Al manejar una solicitud GetConfiguration del sistema central, el gestor copió la cadena JSON 'key' controlada por el atacante en el búfer de pila fijo de 50 bytes del llamador (skey[CISTR50], declarado en subsys/net/lib/ocpp/ocpp.c) usando un strcpy() sin límites. El valor de clave analizado apunta directamente al búfer de recepción, por lo que su longitud está limitada solo por el tamaño del mensaje (CONFIG_OCPP_RECV_BUFFER_SIZE, predeterminado 2048).\n\nEl mensaje GetConfiguration se entrega a través de la conexión WebSocket que el punto de carga abre a su sistema central configurado. El hilo lector ocpp_wsreader() lee el mensaje en ui -> recv_buf y lo despacha a parse_getconfig_msg() a través de la tabla de funciones PDU. Un atacante que controla el punto final del sistema central, o un man-in-the-middle en una conexión no cifrada, puede enviar una solicitud GetConfiguration cuando campo 'key' excede los 50 bytes y desbordar la pila del hilo lector con bytes elegidos por el atacante.\n\nLa consecuencia es un aplastamiento de pila (stack smash) activable remotamente en el hilo lector OCPP: como mínimo una denegación de servicio, y plausiblemente ejecución remota de código dependiendo del endurecimiento en tiempo de compilación, como los canarios de pila y la configuración de MPU. La solución reemplaza el strcpy() con un strncpy(key, payload.key[0], CISTR50 - 1) con límites, seguido de una terminación NUL explícita, coincidiendo con las copias con límites ya utilizadas por los gestores hermanos.","source":"nvd"}],"published":"2026-08-25T04:37:20.629Z","modified":"2026-11-04T05:18:41.540Z","severity":{"scorer":"zephyr","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"zephyr","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"type":"semver","introduced":"4.3.0","fixed":"4.3.2","status":"affected"},{"type":"semver","introduced":"4.4.0","fixed":"4.4.2","status":"affected"}],"vendor":"zephyrproject","product":"zephyr","package":"zephyr","source":"cvelist"}],"references":[{"url":"https://github.com/zephyrproject-rtos/zephyr/commit/afbf880b04188ae53451a0ade4ac62b654fdff34","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-fqhf-6v24-4px2","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"zephyr","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-08-25T15:15:40.750Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-13214","url":"https://www.cve.org/CVERecord?id=CVE-2026-13214","licence":"CVE Terms of Use","modified":"2026-11-04T04:59:50.777Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-13214","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-13214","licence":"Public domain","modified":"2026-11-04T05:18:41.540Z"}],"updatedAt":"2026-11-25T22:59:35.108Z","epss":{"score":0.00511,"percentile":0.45079,"date":"2026-12-01T12:00:22.000Z"}}