Summary
WebSocket endpoints in the OCPP backend accept connections without enforcing proper authentication, allowing any party to impersonate a charging station using a known or guessable identifier.
An unauthenticated attacker can connect to the OCPP WebSocket endpoint, send or receive OCPP commands as if they were a legitimate charger, and potentially escalate privileges to control charging infrastructure and corrupt backend data.
Affected context
The vulnerability arises in backend systems implementing the Open Charge Point Protocol (OCPP) over WebSocket, where charging stations connect to a central system.
It typically manifests when the server accepts WebSocket connections based solely on a charger or station identifier, without requiring cryptographic authentication, session validation, or additional proof of identity.
Environments that expose these WebSocket endpoints over the internet or untrusted networks, and that treat any connected station ID as trusted, are particularly susceptible.
Exploit preconditions
- Attack surface: Public or network-accessible OCPP WebSocket endpoints on the backend.
- Required access: Network reachability to the OCPP server and the ability to open a WebSocket connection.
- Knowledge needed: A valid or guessable charging station identifier (e.g., through observation, documentation, predictable naming, or information leakage).
- Trigger point: Establishing a WebSocket connection and presenting the chosen station identifier, after which the attacker can send or receive OCPP messages as if they were that station.
- Why exploitation is possible: The backend does not enforce robust authentication or binding between the physical device and its logical identifier, implicitly trusting any client that connects with a valid-looking station ID.
Why this happens
This issue is a classic case of CWE-306: Missing Authentication for Critical Function, where a security-sensitive interface is exposed without proper verification of the caller's identity.
In this pattern, the system equates knowledge or use of a station identifier with authenticity, but does not require cryptographic credentials, mutual TLS, token-based proof, or device-bound secrets.
As a result, any client capable of reaching the WebSocket endpoint can assume the identity of a charger and access capabilities that should be restricted to authenticated, legitimate hardware.
Potential impact
- Unauthorized impersonation of charging stations and manipulation of their reported state.
- Remote control of charging operations, including starting, stopping, or altering charging sessions.
- Corruption of billing, metering, and operational data sent from chargers to the backend.
- Disruption of charging availability or denial of service to legitimate users by hijacking or locking station identities.
- Potential cascade effects on grid management, fleet operations, and downstream analytics relying on trusted charging data.
General mitigation guidance
Mitigation centers on enforcing strong, device-level authentication at the OCPP WebSocket boundary and treating station identifiers as non-trustworthy by default.
Common defensive patterns include:
- Requiring mutual TLS (mTLS) so each station presents a unique certificate issued by a trusted CA, and binding station IDs to certificate identities.
- Introducing signed tokens or device-bound secrets that must be presented and validated before accepting OCPP commands.
- Separating station identification from authentication, ensuring that identifiers alone never confer trust or privileges.
- Applying least-privilege design to backend handlers so that even authenticated stations can only perform actions appropriate to their role and state.
- Hardening network exposure of OCPP endpoints with firewalls, VPNs, or private connectivity where feasible to reduce the reachable attack surface.
How teams detect issues like this
Detection efforts typically focus on both design-time and runtime signals:
- Static and design review: Check OCPP WebSocket handlers for authentication and authorization steps; flag flows that accept station IDs without subsequent credential checks.
- Configuration and policy review: Verify that TLS is enabled, evaluate whether mutual TLS is configured, and confirm that station certificates or credentials are uniquely bound to devices.
- Logging and anomaly monitoring: Monitor for unusual patterns such as multiple geographic locations asserting the same station ID, sudden bursts of commands from previously inactive stations, or conflicting data from a single identifier.
- Automated analysis: Use security linters or API gateways with security policies to ensure critical WebSocket endpoints require authentication and are not accidentally exposed without protection.

