# Ev Charging Security

> Use when assessing electric vehicle charging security on a charger, vehicle, and backend you own or are authorized to test. Covers ISO 15118 Plug and Charge certificate handling, OCPP backend authentication and authorization, charging session hijack and billing abuse checks, charger firmware and physical exposure, and load management abuse. Also use when a charging deployment needs its vehicle to grid communication reviewed before rollout.

- Skill: `mizazhaider-ceh/ev-charging-security` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/ev-charging-security`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/ev-charging-security/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/ev-charging-security

---


An EV charger sits at the meeting point of three trust domains, the
vehicle, the charge point operator backend, and the energy grid, and
a flaw in any one of them can move money, energy, or personal data.
ISO 15118 handles vehicle to charger authentication, OCPP handles
charger to backend management, and both have certificate, identity,
and authorization checks that fail quietly when misconfigured. This
sub-skill covers authorized testing of that chain on your own
charger and vehicle, or a lab charger, with no testing against
public infrastructure you do not operate.

## Quick Workflow

1. Map the charging chain on the lab setup, vehicle, charger,
   backend, and any energy management system in between.
2. Capture a full charging session, from plug-in through
   authorization to stop and billing record.
3. Review the ISO 15118 handshake, certificate chain, and which
   payment or contract credentials the charger accepts.
4. Review the OCPP connection, charger identity, authentication,
   and which messages the backend accepts from the charger.
5. Test authorization boundaries, one account or charger acting on
   another account session or another charger identity.
6. Test session handling, stopping, resuming, and billing after
   disconnects, since billing abuse hides in edge transitions.
7. Check the charger itself, open ports, debug interfaces, and
   physical access to its network and storage.
8. Report each finding with the trust boundary it crosses and the
   billing, energy, or privacy impact it enables.

## 1. Capture and review an ISO 15118 session

The handshake is where certificate trust is decided, so capture it
in full before any active testing. Note the certificate chain
presented, the contract or payment method selected, and whether the
charger falls back to a weaker method when the strong one fails.

```bash
# Capture charging communication on the lab charger network segment
# Restrict the capture to the lab charger and lab vehicle addresses.
sudo tcpdump -i eth0 -w charging_session.pcap \
  host 192.168.30.10 or host 192.168.30.20
# List TLS handshakes and certificate exchanges in the capture
tshark -r charging_session.pcap -Y tls.handshake -T fields \
  -e ip.src -e tls.handshake.type | sort | uniq -c
```

```python
# ISO 15118 review checklist, answered from the capture and charger docs
checks = {
    "certificate_chain_validates": "yes, no, or unknown",
    "expired_or_revoked_cert_rejected": "yes, no, or unknown",
    "fallback_to_unauthenticated_charging": "yes, no, or unknown",
    "contract_certificate_bound_to_vehicle": "yes, no, or unknown",
    "payment_data_in_cleartext": "yes, no, or unknown",
}
for question, answer in checks.items():
    print(f"{question}: {answer}")
```

## 2. OCPP backend authentication and authorization tests

A charger authenticates to its backend with an identity and a
secret, and the backend must not trust a charger identity it has
not issued. Test with lab chargers only, checking whether one lab
charger can impersonate another, start sessions for another
account, or read another charger configuration.

```bash
# Enumerate the lab OCPP endpoint surface from the charger config
# Use the lab backend address only, never a production operator.
sudo nmap -sV -p 443,8080,8443 192.168.30.5
# Confirm the OCPP connection uses TLS and which version is offered
python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"
```

```python
# OCPP authorization test cases, run against the lab backend only
# Each case uses lab accounts and lab charger identities.
test_cases = [
    "charger A authenticates with charger B identity",
    "account A stops account B charging session",
    "account A reads account B charging history",
    "charger requests a firmware update from an untrusted source",
    "charger accepts a remote start for a session it did not create",
]
for case in test_cases:
    print(f"test case: {case} - record accepted, rejected, or error")
```

## 3. Session, billing, and load management abuse checks

Billing records are built from meter values the charger reports,
so check whether the backend validates them, and whether a charger
can report values that understate energy delivered. Load management
is the grid-facing risk, so check whether one charger can request
power beyond its allocated limit.

```bash
# Session edge test procedure on the lab charger
# 1. Start a session, disconnect mid-charge, reconnect, and compare
#    the billed energy with the metered energy.
# 2. Stop a session from the backend, then from the charger, and
#    confirm only one billing record is created.
# 3. Request maximum power from two lab chargers at once and check
#    the load limit is enforced per site, not per charger.
echo "session edge tests ready - record metered vs billed per run"
```

```python
# Billing reconciliation check on lab session records
# Metered energy comes from the charger meter, billed from the backend.
sessions = [
    {"id": "lab-001", "metered_kwh": 22.4, "billed_kwh": 22.4},
    {"id": "lab-002", "metered_kwh": 18.1, "billed_kwh": 18.1},
]
for session in sessions:
    delta = abs(session["metered_kwh"] - session["billed_kwh"])
    status = "MATCH" if delta < 0.1 else "MISMATCH - investigate"
    print(f"{session['id']} delta {delta:.2f} kWh - {status}")
```

## Edge cases

- Certificate provisioning: a lab vehicle without a valid contract
  certificate will fall back or fail, and that behaviour must be
  distinguished from a production misconfiguration before it is
  reported as a finding.
- OCPP version differences: OCPP 1.6 and 2.0.1 differ in security
  profiles, so a check that passes on one version may be
  meaningless on the other, and the version under test is recorded.
- Offline charging: chargers that lose backend connectivity may
  authorize locally and sync later, so billing and authorization
  findings need an offline and an online run each.
- Shared chargers: a charger used by many drivers mixes session
  data, so authorization tests need distinct lab accounts, or a
  cross-account result may be a test artefact.
- Grid signals: load management responses depend on site limits
  and grid signals that a lab may not reproduce, so load findings
  are scoped to the lab configuration that produced them.
- Physical access: a publicly sited charger is physically exposed,
  so network findings must be read together with what an attacker
  with hands on the charger can reach.

## Key references

- ISO 15118, road vehicles vehicle to grid communication interface,
  for Plug and Charge, certificate handling, and session setup.
- Open Charge Point Protocol (OCPP) specifications, for charger to
  backend messaging, security profiles, and firmware management.
- ISO 21434, road vehicles cybersecurity engineering, for threat
  analysis and risk assessment framing of charging findings.
- The parent skill telematics-security, for backend API review and
  remote command tracing that the OCPP backend assessment builds on.

