News: 1660767549

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Software developer cracks Hyundai car security with Google search

(2022/08/17)


A developer says he was able to run his own software on his car infotainment hardware after discovering the vehicle's manufacturer had secured its system using keys that were not only publicly known but had been lifted from programming examples.

Daniel Feldman, a Minneapolis, Minnesota-based software engineer, wanted to modify the in-vehicle infotainment (IVI) system in his 2021 Hyundai Ioniq SEL.

To do so, he would have to figure out how to connect to the device and bypass its security.

[1]

After trying to figure out how to customize firmware updates for the IVI's D-Audio2 system, made by the car company's mobility platform subsidiary Hyundai Mobis, and have them accepted by the IVI, Feldman found an unexpected way – through Google.

[2]

[3]

The IVI accepts firmware updates in the form of password-protected ZIP archives. Feldman downloaded an update ZIP from Hyundai's website and was able to bypass the simple password protection on the archive to access its contents, which included encrypted firmware images for various parts of the IVI.

His goal then became creating his own firmware images and encrypt them in a way within a ZIP that the car would accept, install, and run, thus allowing him to take control of the hardware from his own supplied code.

[4]

As luck would have it, Feldman found on Mobis's website a Linux setup script that created a suitable ZIP file for performing a system update.

Turns out the encryption key in that script is the first AES 128-bit CBC example key listed in a NIST document

The script included the necessary ZIP password for the system update archives, along with an AES symmetric Cipher-Block-Chaining (CBC) encryption key (a single key rather than an RSA asymmetric public/private key pair) and the IV (initialization vector) value to encrypt the firmware images.

This information could also be used to decrypt the images.

That meant he could use the AES key to decrypt the firmware images, modify them, and then use the script to re-encrypt the images using the AES key and package it all up into a password-protected ZIP for Hyundai's IVI update system to ingest.

But it wasn't going to be that easy: some part of the supplied data, at least, would need to be cryptographically signed using an RSA private key, and Feldman didn't have it. The updater would use the private key's corresponding RSA public key to check the data was signed using the correct secret private key.

[5]

He thus needed to find the RSA private key to get any further.

"The script hinted at RSA signing being used, but unfortunately the key used for that was not in the source code," Feldman explained in [6]a blog post back in May that was brought to our attention by a reader this week.

"Turns out the [AES] encryption key in that script is the first AES 128-bit CBC example key listed in the NIST document [7]SP800-38A [PDF]," he added.

As an aside, the consensus in the crypto community appears to be that CBC is [8]difficult to use properly and other approaches are recommended. Microsoft last year warned that the use of AES CBC [9]with padding may not be secure.

"Microsoft believes that it's no longer safe to decrypt data encrypted with the Cipher-Block-Chaining (CBC) mode of symmetric encryption when verifiable padding has been applied without first ensuring the integrity of the ciphertext, except for very specific circumstances," the company [10]said . "This judgment is based on currently known cryptographic research."

But Hyundai's fault isn't misimplementing AES CBC; it's using yet another key published online as a secret.

[11]Hyundai reveals the robotaxi it built for Lyft, and a version for its very own metaverse

[12]Driverless car first: Chinese biz recalls faulty AI

[13]Toyota, Subaru recall EVs because tires might literally fall off

[14]Car makers lock in long-term deals with chip giants for future autonomous vehicles

With that symmetric key, Feldman was able to extract the contents of one of the encrypted firmware image files within the update ZIP.

And within the extracted files, he found the software that handles IVI updates, a binary called updateAgent. In other words, Feldman was now looking at the very code – the update tool in the IVI in his car – that he needed to defeat, which gave him a sporting chance to beat it.

"Since I already had the zip password and the encryption key, I decided to look for the signing key," explained Feldman. "With any luck they left not only the public key but the private key too."

His luck held out, in a way. Feldman found within the firmware image the RSA public key used by the updater, and searched online for a portion of that key. The search results pointed to a common public key that shows up in online tutorials like " [15]RSA Encryption & Decryption Example with OpenSSL in C ."

That tutorial and [16]other [17]projects [18]implementing OpenSSL include within their source code that public key and the corresponding RSA private key.

This means Hyundai used a public-private key pair from a tutorial, and placed the public key in its code, allowing Feldman to track down the private key. Thus he was able to sign Hyundai's files and have them accepted by the updater.

At that point, Feldman had the opportunity to create custom firmware for his car's IVI, as he describes in [19]two [20]subsequent online posts. He also has [21]summarized his approach for other Hyundai owners.

Hyundai has not responded to a request for comment. ®

Get our [22]Tech Resources



[1] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/research&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Yv1lAud0nRpOJYWTVgScNgAAAE0&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/research&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Yv1lAud0nRpOJYWTVgScNgAAAE0&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/research&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Yv1lAud0nRpOJYWTVgScNgAAAE0&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/research&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Yv1lAud0nRpOJYWTVgScNgAAAE0&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_security/research&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Yv1lAud0nRpOJYWTVgScNgAAAE0&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[6] https://programmingwithstyle.com/posts/howihackedmycar/

[7] https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38a.pdf

[8] https://alicegg.tech/2019/06/23/aes-cbc.html

[9] https://en.wikipedia.org/w/index.php?title=Padding_oracle_attack&oldid=1088720142

[10] https://docs.microsoft.com/en-us/dotnet/standard/security/vulnerabilities-cbc-mode

[11] https://www.theregister.com/2021/09/01/hyundai_ioniq_robotaxis/

[12] https://www.theregister.com/2022/03/10/driverless_car_first_chinese_company/

[13] https://www.theregister.com/2022/06/27/toyota_subaru_recall_evs_because/

[14] https://www.theregister.com/2022/01/06/self_driving_car_makers_chips/

[15] http://hayageek.com/rsa-encryption-decryption-openssl-c/

[16] https://github.com/kYroL01/Decoder/blob/master/test_decr.c

[17] https://gist.github.com/irbull/08339ddcd5686f509e9826964b17bb59?permalink_comment_id=3174518

[18] https://stackoverflow.com/questions/31398253/linking-problems-in-compiling-a-simple-rsa-encryption-c-code

[19] https://programmingwithstyle.com/posts/howihackedmycarpart2/

[20] https://programmingwithstyle.com/posts/howihackedmycarpart3/

[21] https://programmingwithstyle.com/posts/howihackedmycarguidescreatingcustomfirmware/

[22] https://whitepapers.theregister.com/



threenub

But can it run doom?

diodesign

[1]Probably!

You can run whatever app you want on it.

C.

[1] https://programmingwithstyle.com/posts/howihackedmycarpart3/images/WIN_20220506_16_18_01_Pro.jpg

b0llchit

Yes, yes, but "whatever app" does not compare to Doom!

;-)

spireite

If you could run Doom on it........

...... that would be Iconic

Paul Herber

How about Doom Bar?

OhForF'

Looks like somebody took the common advice a bit too far.

"Don't create your own algorithm - use something the experts developed and checked" does apply to the algorithm - not the keys.

I wonder what the password for zip file was, "password" or "secret"?

Hyundai used a public-private key pair from a tutorial, and placed the public key in its code

Howard Sway

Classic. There's following the steps in a tutorial EXACTLY, and then there's actually bothering to try and understand what it's really telling you by also applying your brain when reading it. I wonder if this tutorial example made its way onto Stack Overflow, and if so how many other systems have been "secured" the same way...........

Hyundai won't comment

AlanSh

I've got a Hyundai wihich has some basic issues with the infotainment system. I (and others) have tried to make Hyundai respond to this - but there's a great silence.

It'll be another head in the sand job with this issue too.

JDPower666

Don't publicise it, these are the security holes we all want left in our cars so we can easily crack the firmware after manufacturers decide to lock every function of the car if you don't give them money every month!

Outsourced

david 12

Some contractor built the code and handed it over, with the documentation: just change the keys and it's good to go.

<xtifr> you don't have to be insane to work here....oh wait, yes you do!
:)