How I hacked my car (2021 Hyundai Ioniq SEL) : Part 1
The firmware update for the car's infotainment system was encrypted with a hardcoded AES key and signed with a hardcoded RSA private key, both found in publicly available source code. An attacker could decrypt and modify the firmware to install a backdoor, gaining root access to the system.
programmingwithstyle.com
Published on programmingwithstyle.com
Note: As of 2022/10/25 the information in this series is slightly outdated. See Part 5 for more up to date information.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The firmware update encryption and signing keys were hardcoded in a publicly available shell script, and the encryption key was a well-known example key from a NIST document.
Impact
An attacker could decrypt and modify the firmware update to install a backdoor, gaining root access to the infotainment system, though the text notes that a firmware update for the specific car was not yet available and the RSA signing key was also hardcoded.
What the attacker needed
Physical access to the car's USB port; firmware update file from Hyundai; knowledge of zip encryption cracking
The fix
The hardcoded encryption and signing keys should be replaced with securely generated, unique keys, and the update process should be properly secured.
How it was found
- Download the firmware update from Hyundai's website.
- Extract the outer zip to find an encrypted inner zip.
- Use bkcrack with a known plaintext file to recover the zip encryption keys.
- Extract the system image and reverse engineer applications.
- Find the shell script linux_envsetup.sh in Mobis's open-source code.
- Use the hardcoded AES key and IV from the script to decrypt the updateboot.img file.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The car's entertainment system gets software updates from the manufacturer. These updates were locked with a password and a secret code, but the password and code were left in publicly available files. Anyone who found them could unlock the update, change it to include malicious software, and install it on the car.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.