Summary
A missing authentication flaw in OCPP WebSocket endpoints allows any party to connect as if they were a legitimate charging station using only a known or guessable station identifier.
Once connected, an attacker can send or receive OCPP commands as a charger, potentially escalating privileges, taking unauthorized control of charging infrastructure, and corrupting backend charging data.
Affected context
This vulnerability appears in EV charging backends that expose OCPP WebSocket interfaces without enforcing strong authentication for connecting charging stations.
It typically manifests where:
- Charging stations identify themselves only by an ID over WebSocket
- The backend implicitly trusts any client that presents a valid-looking station identifier
- No additional credential, certificate, token, or mutual TLS check is required
The issue is most relevant in multi-station deployments where station IDs can be enumerated, guessed, or leaked from configuration, network traffic, or physical labels on chargers.
Exploit preconditions
- Attack surface: Public or network-accessible OCPP WebSocket endpoint exposed by the charging backend.
- Required access: Network-level ability to reach the WebSocket endpoint (e.g., internet access or access to the operator's internal network).
- Attacker knowledge: A valid or guessable charging station identifier (e.g., from logs, signage, default naming patterns, or protocol enumeration).
- Trigger point: Initiating a WebSocket connection to the OCPP endpoint and presenting the chosen station identifier without being challenged for authentication.
- Why exploitation is possible: The backend equates "knows a station ID" with "is that station," lacking any independent verification of station identity or authorization.
Why this happens
The root cause is a missing authentication control on the OCPP WebSocket endpoint, aligning with CWE-306: Missing Authentication for Critical Function.
The backend treats the act of connecting with a charging station identifier as sufficient proof of legitimacy, effectively binding identity to a user-controlled field.
This design assumes a trusted network and does not account for attackers who can observe or guess station identifiers and then impersonate them.
Because there is no cryptographic or credential-based verification, the system cannot distinguish between a genuine charger and an attacker emulating one over WebSocket.
Potential impact
- An attacker may impersonate a charging station and send arbitrary OCPP commands to the backend.
- Attackers could manipulate session starts, stops, and configuration changes, leading to unauthorized control of charging operations.
- Charging network usage, billing, and telemetry data can be falsified, leading to corrupted reporting and incorrect invoicing.
- Operators may lose visibility into real charging behavior, undermining monitoring, maintenance, and safety processes.
- In certain environments, orchestrated manipulation could contribute to grid instability or operational disruptions if many stations are controlled at once.
General mitigation guidance
Effective mitigation focuses on enforcing strong, device-bound authentication and minimizing implicit trust in identifiers:
- Require mutual authentication between charging stations and the backend (for example, device certificates or other cryptographically verifiable credentials) rather than relying solely on station IDs.
- Bind each station identifier to a secret or private key that cannot be derived or reused by other clients, and validate this during WebSocket connection establishment.
- Treat OCPP WebSocket endpoints as sensitive control interfaces and place them behind access control layers such as API gateways or dedicated authentication proxies.
- Limit the privileges associated with each station identity so that compromise of a single station cannot easily be leveraged to affect others.
- Apply defense-in-depth at the network layer (segmentation, firewall rules, VPNs) to reduce exposure of charging control interfaces to untrusted networks.
- Introduce robust authorization checks on backend operations so that only expected actions for a given station and state are permitted, even after authentication.
How teams detect issues like this
Detection can focus on both design-level flaws and runtime anomalies:
- Static and architectural review: Examine WebSocket connection handlers to verify the presence of explicit authentication and authorization checks before processing OCPP messages.
- Code scanning patterns: Flag endpoints or controllers that accept station identifiers from clients but do not verify associated credentials, signatures, or certificates.
- Configuration and policy checks: Use security policies or automated reviews to ensure OCPP endpoints are not exposed without an authentication layer, such as mutual TLS or token-based schemes.
- Runtime monitoring: Log and analyze connection patterns for indicators of impersonation, such as the same station ID connecting from multiple IP ranges or geographies, unusual message volumes, or anomalous timing.
- Security testing: Include targeted penetration tests that attempt to connect as arbitrary station IDs to validate that authentication and authorization controls are enforced.

