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
- Map the update chain, build signing, update server, delivery
network, vehicle gateway, and target ECU.
- Obtain a genuine update package from the lab pipeline and record
its signature, version, target hardware, and metadata.
- Verify the signature and version checks on the bench ECU with a
genuine package, establishing the passing baseline.
- Test each trust link in turn, signature, transport, version,
target, and metadata, changing one variable per test.
- Test rollback, offering an older signed package and an older
unsigned package to the bench ECU.
- Test failure handling, interrupted downloads, corrupt packages,
and power loss during install, on the bench only.
- Test server-side authorization, whether one lab vehicle can fetch
another vehicle update or a different hardware variant.
- 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.
# 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
# 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.
# 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"
# 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.
# 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"
# 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.
1---2name: ota-update-security-testing3parent: ecu-firmware4description: 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.5version: 1.0.06domain: automotive7lifecycle: stable8last_verified: '2026-10-27'9requires: [ecu-firmware]10extends: []11relates: [can-bus-security, automotive-threat-model, telematics-security]12tools:13 - name: Python14 version: '3.12'15 - name: Ghidra16 version: '11.3'17 - name: binwalk18 version: '2.3.4'19metadata:20 source: https://skillmd.com/skills/mizazhaider-ceh/ota-update-security-testing21---2223An over-the-air update is a remote code execution channel the24manufacturer built on purpose, so its security rests entirely on the25trust chain around it, signing, transport authentication, version26policy, and safe recovery. If any link accepts unsigned, downgraded,27or misdirected packages, the update channel becomes the attack path.28This sub-skill covers testing that chain on bench ECUs and lab29update servers you control, never against a production fleet, and30never by flashing a vehicle you depend on.3132## Quick Workflow33341. Map the update chain, build signing, update server, delivery35 network, vehicle gateway, and target ECU.362. Obtain a genuine update package from the lab pipeline and record37 its signature, version, target hardware, and metadata.383. Verify the signature and version checks on the bench ECU with a39 genuine package, establishing the passing baseline.404. Test each trust link in turn, signature, transport, version,41 target, and metadata, changing one variable per test.425. Test rollback, offering an older signed package and an older43 unsigned package to the bench ECU.446. Test failure handling, interrupted downloads, corrupt packages,45 and power loss during install, on the bench only.467. Test server-side authorization, whether one lab vehicle can fetch47 another vehicle update or a different hardware variant.488. Report each bypass with the exact package modification that49 produced it and the recovery behaviour observed.5051## 1. Inspect a genuine update package5253Start from a genuine package and document its structure before54modifying anything. A test that modifies a package without first55recording the original cannot tell a verification failure from a56malformed test input.5758```bash59# Inspect the structure of a lab update package without installing it60binwalk lab_update_v2.3.1.bin61# List the package contents if it is an archive or container62python3 -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"63# Record hashes of the original package before any test modifies it64sha256sum lab_update_v2.3.1.bin > lab_update_v2.3.1.sha25665cat lab_update_v2.3.1.sha25666```6768```python69# Package metadata checklist, filled in from the genuine package70metadata = {71 "version": "from package manifest",72 "target_hardware": "from package manifest",73 "signature_present": "yes or no",74 "signature_algorithm": "from manifest or header",75 "rollback_counter": "from manifest or header",76 "payload_hash_matches_manifest": "yes or no",77}78for key, value in metadata.items():79 print(f"{key}: {value}")80```8182## 2. Signature and rollback tests on the bench8384Each test changes exactly one thing, so a bypass can be attributed85to the link that failed. Never run these tests on a vehicle in86service, and keep a known-good package ready to restore the bench87ECU after every test.8889```bash90# Test matrix, one modification per run, bench ECU only91# Run 1: genuine package, expect install success (baseline).92# Run 2: payload modified, signature untouched, expect rejection.93# Run 3: signature stripped, expect rejection.94# Run 4: manifest version raised without re-signing, expect rejection.95# Run 5: older signed package (rollback), expect rejection if the96# rollback counter is enforced.97# After each run, restore the bench ECU with the genuine package98# before starting the next run.99echo "OTA test matrix ready - log accept or reject per run"100```101102```python103# Verify a package signature offline before offering it to the ECU104# This checks your understanding of the format, it does not replace105# the ECU verification test, which is the result that matters.106import hashlib107108with open("lab_update_v2.3.1.bin", "rb") as handle:109 digest = hashlib.sha256(handle.read()).hexdigest()110print(f"package sha256: {digest}")111# Compare against the manifest hash and the recorded original hash.112# A mismatch here means the test package was corrupted in handling,113# not that the ECU rejected it.114```115116## 3. Update server authorization and delivery tests117118The server decides which vehicle gets which package, so test that119decision with lab vehicle identities. A server that hands any120authenticated vehicle any package lets an attacker collect firmware121for hardware they do not own, and may let them push a package to a122vehicle that should not receive it.123124```bash125# Lab update server test procedure, lab identities only126# 1. Request the update manifest as lab vehicle A, record the offer.127# 2. Request the same manifest as lab vehicle B (different hardware128# variant), and compare the offer.129# 3. Request vehicle A manifest with vehicle B credentials, and130# record whether the server distinguishes the two.131# 4. Request a manifest over plain HTTP if the client allows it,132# and record whether the client refuses the insecure transport.133echo "server authorization tests ready - use lab identities only"134```135136```python137# Differential update integrity check on a lab delta package138# A delta applies cleanly only to its stated base version, so test139# applying it to the wrong base and confirm the result is rejected140# rather than a corrupted install.141delta_tests = [142 "delta applied to correct base version",143 "delta applied to older base version",144 "delta applied to newer base version",145 "delta with one byte flipped in the payload",146]147for test in delta_tests:148 print(f"delta test: {test} - record install result and ECU state")149```150151## Edge cases152153- A/B update slots: a bench ECU with dual slots may report success154 while booting the old slot, so every install test must confirm155 the running version after reboot, not just the install return code.156- Staged rollouts: a lab server may offer different packages by157 region, variant, or rollout percentage, so a manifest result is158 only valid for the lab identity and cohort that requested it.159- Interrupted installs: power loss timing changes the outcome, so160 interruption tests are repeated at several points in the install,161 and recovery behaviour is recorded per point.162- Signature format confusion: a package can carry several signatures163 or a detached manifest, and testing only one of them can miss a164 second verification path that the ECU actually trusts.165- Gateway caching: a vehicle gateway may cache a package and serve166 the cached copy after the server revokes it, so revocation tests167 must check the gateway cache as well as the server.168- Recovery images: a failed update that falls back to a recovery169 image with old vulnerabilities is itself a finding, and the170 recovery image version is recorded alongside the main result.171172## Key references173174- ISO 21434, road vehicles cybersecurity engineering, for threat175 analysis, secure update requirements, and vulnerability handling176 that frame the update trust chain.177- UN Regulation No. 156 on software update management systems, for178 the regulatory expectations on update integrity and record keeping.179- The Uptane framework documentation, for a reference design on180 secure update roles, rollback protection, and compromise recovery.181- The parent skill ecu-firmware, for firmware extraction, update182 package analysis, and UDS flashing flows that this sub-skill183 builds on.