# Ota Update Security Testing

> Use when testing over-the-air update security for a vehicle platform or bench ECU you own or are authorized to test. Covers update package signing and verification, rollback protection, update server authentication, differential update integrity, failed update recovery, and fleet-wide rollout abuse. Also use when an update pipeline needs its end to end trust chain reviewed before a release ships.

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

---


An over-the-air update is a remote code execution channel the
manufacturer built on purpose, so its security rests entirely on the
trust chain around it, signing, transport authentication, version
policy, and safe recovery. If any link accepts unsigned, downgraded,
or misdirected packages, the update channel becomes the attack path.
This sub-skill covers testing that chain on bench ECUs and lab
update servers you control, never against a production fleet, and
never by flashing a vehicle you depend on.

## Quick Workflow

1. Map the update chain, build signing, update server, delivery
   network, vehicle gateway, and target ECU.
2. Obtain a genuine update package from the lab pipeline and record
   its signature, version, target hardware, and metadata.
3. Verify the signature and version checks on the bench ECU with a
   genuine package, establishing the passing baseline.
4. Test each trust link in turn, signature, transport, version,
   target, and metadata, changing one variable per test.
5. Test rollback, offering an older signed package and an older
   unsigned package to the bench ECU.
6. Test failure handling, interrupted downloads, corrupt packages,
   and power loss during install, on the bench only.
7. Test server-side authorization, whether one lab vehicle can fetch
   another vehicle update or a different hardware variant.
8. Report each bypass with the exact package modification that
   produced it and the recovery behaviour observed.

## 1. Inspect a genuine update package

Start from a genuine package and document its structure before
modifying anything. A test that modifies a package without first
recording the original cannot tell a verification failure from a
malformed test input.

```bash
# Inspect the structure of a lab update package without installing it
binwalk lab_update_v2.3.1.bin
# List the package contents if it is an archive or container
python3 -c "import zipfile, sys; z = zipfile.ZipFile('lab_update_v2.3.1.zip'); print('\n'.join(z.namelist()))" 2>/dev/null || echo "not a zip container - see binwalk output"
# Record hashes of the original package before any test modifies it
sha256sum lab_update_v2.3.1.bin > lab_update_v2.3.1.sha256
cat lab_update_v2.3.1.sha256
```

```python
# Package metadata checklist, filled in from the genuine package
metadata = {
    "version": "from package manifest",
    "target_hardware": "from package manifest",
    "signature_present": "yes or no",
    "signature_algorithm": "from manifest or header",
    "rollback_counter": "from manifest or header",
    "payload_hash_matches_manifest": "yes or no",
}
for key, value in metadata.items():
    print(f"{key}: {value}")
```

## 2. Signature and rollback tests on the bench

Each test changes exactly one thing, so a bypass can be attributed
to the link that failed. Never run these tests on a vehicle in
service, and keep a known-good package ready to restore the bench
ECU after every test.

```bash
# Test matrix, one modification per run, bench ECU only
# Run 1: genuine package, expect install success (baseline).
# Run 2: payload modified, signature untouched, expect rejection.
# Run 3: signature stripped, expect rejection.
# Run 4: manifest version raised without re-signing, expect rejection.
# Run 5: older signed package (rollback), expect rejection if the
#        rollback counter is enforced.
# After each run, restore the bench ECU with the genuine package
# before starting the next run.
echo "OTA test matrix ready - log accept or reject per run"
```

```python
# Verify a package signature offline before offering it to the ECU
# This checks your understanding of the format, it does not replace
# the ECU verification test, which is the result that matters.
import hashlib

with open("lab_update_v2.3.1.bin", "rb") as handle:
    digest = hashlib.sha256(handle.read()).hexdigest()
print(f"package sha256: {digest}")
# Compare against the manifest hash and the recorded original hash.
# A mismatch here means the test package was corrupted in handling,
# not that the ECU rejected it.
```

## 3. Update server authorization and delivery tests

The server decides which vehicle gets which package, so test that
decision with lab vehicle identities. A server that hands any
authenticated vehicle any package lets an attacker collect firmware
for hardware they do not own, and may let them push a package to a
vehicle that should not receive it.

```bash
# Lab update server test procedure, lab identities only
# 1. Request the update manifest as lab vehicle A, record the offer.
# 2. Request the same manifest as lab vehicle B (different hardware
#    variant), and compare the offer.
# 3. Request vehicle A manifest with vehicle B credentials, and
#    record whether the server distinguishes the two.
# 4. Request a manifest over plain HTTP if the client allows it,
#    and record whether the client refuses the insecure transport.
echo "server authorization tests ready - use lab identities only"
```

```python
# Differential update integrity check on a lab delta package
# A delta applies cleanly only to its stated base version, so test
# applying it to the wrong base and confirm the result is rejected
# rather than a corrupted install.
delta_tests = [
    "delta applied to correct base version",
    "delta applied to older base version",
    "delta applied to newer base version",
    "delta with one byte flipped in the payload",
]
for test in delta_tests:
    print(f"delta test: {test} - record install result and ECU state")
```

## Edge cases

- A/B update slots: a bench ECU with dual slots may report success
  while booting the old slot, so every install test must confirm
  the running version after reboot, not just the install return code.
- Staged rollouts: a lab server may offer different packages by
  region, variant, or rollout percentage, so a manifest result is
  only valid for the lab identity and cohort that requested it.
- Interrupted installs: power loss timing changes the outcome, so
  interruption tests are repeated at several points in the install,
  and recovery behaviour is recorded per point.
- Signature format confusion: a package can carry several signatures
  or a detached manifest, and testing only one of them can miss a
  second verification path that the ECU actually trusts.
- Gateway caching: a vehicle gateway may cache a package and serve
  the cached copy after the server revokes it, so revocation tests
  must check the gateway cache as well as the server.
- Recovery images: a failed update that falls back to a recovery
  image with old vulnerabilities is itself a finding, and the
  recovery image version is recorded alongside the main result.

## Key references

- ISO 21434, road vehicles cybersecurity engineering, for threat
  analysis, secure update requirements, and vulnerability handling
  that frame the update trust chain.
- UN Regulation No. 156 on software update management systems, for
  the regulatory expectations on update integrity and record keeping.
- The Uptane framework documentation, for a reference design on
  secure update roles, rollback protection, and compromise recovery.
- The parent skill ecu-firmware, for firmware extraction, update
  package analysis, and UDS flashing flows that this sub-skill
  builds on.

