🔍 CVE-2026-13217

5.9
CVSS Score
MEDIUM
2026-08-25
2026-11-04 05:18
✅ 완료

🇰🇷 한글 설명

Zephyr OCPP 1.6 클라이언트가 CALLRESULT 메시지의 uid 필드를 파싱할 때 strtok_r() 반환값을 검사하지 않아 NULL 포인터 역참조가 발생합니다. 수정 패치는 첫 번째 토큰만 보호하며, 두 번째 토큰 처리 구간은 여전히 취약합니다.

💡 쉬운 설명

충전기가 중앙 서버로부터 잘못된 형식의 응답을 받으면 프로그램이 잘못된 메모리 주소에 접근하여 멈출 수 있습니다. 이로 인해 충전기 서비스가 중단될 수 있습니다.

🇺🇸 원문 (English)

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.

📍 영향받는 시스템

Zephyr RTOS의 OCPP 1.6 클라이언트를 사용하는 충전기 펌웨어 (MMU/MPU 또는 NULL 포인터 검출 활성화 플랫폼)

⚔️ 공격 벡터

악意적이거나 침해된 중앙 시스템, 또는 비TLS(ws://) 연결에 대한 중간자 공격으로 빈 uid 또는 '-' 구분자가 없는 uid를 포함한 메시지를 전송

🛡️ 대응 방법

ocpp_process_server_msg() 함수에서 두 번째 strtok_r() 호출 결과를 NULL 체크하고, 모든 토큰 파싱 결과를 검증하는 완전한 패치를 적용하며, 가능하면 wss:// (TLS) 연결을 사용

🔧 검증 코드

출력된 strtok_r 호출 라인마다 바로 다음 줄에 NULL 체크(if (!tok) 등)가 있는지 확인하며, 두 번째 strtok_r(NULL, "-", ...) 호출에도 검사가 있으면 패치가 완전히 적용된 것이고, 없으면 취약 상태입니다.

Shell / Script
grep -rn 'strtok_r' $ZEPHYR_BASE/subsys/net/lib/ocpp/ocpp.c 2>/dev/null | head -20

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

💻 영향받는 소프트웨어

Splunk MCP Server app