Summary
The OCPP WebSocket endpoint accepts connections from charging stations without enforcing any authentication or identity verification.
An attacker who knows or can guess a charging station identifier can connect as that station, send or receive OCPP commands, and manipulate data flowing to the backend, enabling unauthorized control of charging infrastructure and corruption of network data.
Affected context
This vulnerability affects environments where charging stations communicate with a backend over OCPP using WebSocket endpoints that do not require authentication, mutual TLS, or cryptographic station identification.
It is most relevant when:
- Station identifiers are predictable, discoverable, or reused
- The WebSocket endpoint is reachable from untrusted networks (e.g., internet-exposed)
- The backend trusts the identity implied by the WebSocket connection without additional checks
Exploit preconditions
- Attack surface: Network-accessible OCPP WebSocket endpoint used by charging stations.
- Required access: Ability to reach the WebSocket endpoint from an external or internal network; no prior authentication if the endpoint is exposed as described.
- Trigger point: Initiating a WebSocket connection using a valid or guessed charging station identifier and then exchanging OCPP messages.
- Why exploitation is possible: The backend implicitly trusts the station identifier provided in the unauthenticated WebSocket session and does not enforce strong client authentication, allowing arbitrary clients to impersonate legitimate stations.
Why this happens
This issue stems from a design-level failure to enforce authentication on a network endpoint that makes authorization decisions based on claimed identity.
According to CWE-306: Missing Authentication for Critical Function, critical interfaces must verify the identity of clients before allowing access or control. In this case, the OCPP WebSocket endpoint assumes that any client presenting a station identifier is the legitimate charging station. There is no cryptographic proof of identity, no binding between the station identifier and a credential, and no additional verification at connection time. As a result, attackers can impersonate stations and gain unauthorized privileges simply by connecting with a valid identifier.
Potential impact
- An attacker may impersonate a charging station and issue OCPP commands as that station.
- An attacker could disrupt or control charging sessions, including starting, stopping, or altering configuration parameters.
- The integrity of operational and billing data reported to the backend can be corrupted or falsified.
- Attackers may cause incorrect reporting of energy usage, transactions, or availability, impacting billing and fleet management systems.
- Coordinated attacks could degrade or deny service across parts of the charging network by taking many stations "offline" or misconfiguring them.
General mitigation guidance
Effective mitigation focuses on enforcing robust, identity-bound authentication for all OCPP WebSocket connections and avoiding trust in unauthenticated identifiers.
Recommended defensive patterns include:
- Requiring strong client authentication (e.g., mutual TLS, token-based schemes, or signed station credentials) for all charging stations before accepting OCPP messages.
- Binding each station identifier to a unique, provisioned credential or certificate and validating this binding at connection time.
- Treating station identifiers as untrusted input and avoiding using them alone for authorization decisions.
- Applying least-privilege principles so that any unauthenticated or partially authenticated connection has no ability to execute sensitive OCPP commands.
- Segmenting and filtering network access so only expected charging station networks can reach backend WebSocket endpoints, reducing exposure to arbitrary internet clients.
How teams detect issues like this
Detection typically involves examining both code and runtime behavior for missing or ineffective authentication controls.
High-level approaches include:
- Static analysis and architectural reviews to identify WebSocket/OCPP endpoints that:
- Do not invoke authentication middleware or security filters
- Accept station identifiers without verifying a corresponding credential
- Use identity claims directly from connection parameters without validation
- Reviewing configuration of WebSocket servers, API gateways, or load balancers to ensure authentication policies are enforced consistently on OCPP endpoints.
- Adding security logging around connection establishment, including:
- Source IP ranges
- Station identifiers used
- Presence or absence of client certificates or tokens
and monitoring for anomalies such as:
- Multiple concurrent connections using the same station identifier from different networks
- Stations connecting from unexpected geolocations or IP addresses.
- Leveraging automated security testing tools or scripts to probe the OCPP WebSocket endpoint with arbitrary identifiers and verify whether authentication is enforced.

