SlideShare a Scribd company logo
1 of 49
Download to read offline
©2022 CYMOTIVE Technologies Ltd. All Rights Reserved.
Unauthorized use, duplication, disclosure or modification of
this document is strictly prohibited. CYMOTIVE Technologies
makes no representations regarding the correctness or
completeness of the content herein.
Benny Meisels
99% Complete, Don’t Turn Off Your Car
Automotive OTA Security For The Connected Vehicle
About Me
• Benny Meisels
• Lead Solution Architect @ CYMOTIVE
• 9 years in IT and embedded security
research
• Enjoys working on electronic
conference badges
2
Motivation
• OTA adoption is on the rise
• Automotive OTA is complicated
• Complexity == Harder to secure
• We believe regulations are the
“minimum requirements”
3
Agenda
• Classic And OTA Updates Intro
• Design Security Considerations
• Implementation Misconceptions
• “The Server Is Always Authentic”
• “Using A Signature Is Enough”
• “Local Storage Is Secure”
• And the resulting vulnerabilities
• Suggestions For Process Improvement
4
Classic And OTA Updates Intro
5
ECU Update Objectives
• Address recall / Fix issues
• Safety
• Compatibility
• Usability
• Security
• Update function data (Maps, ...)
• Add new features
6
ECU Flashing – Classic Approach
• Diagnostic tester
• UDS (ISO 14229-1) over CAN
• DoIP (ISO 13400-2) over Ethernet
• USB
7
ECU Flashing – Diagnostic Tester
• Tester is connected to the OBD
• Flashing SW uses the tester to send UDS
messages according to the ISO 14229-1
standard
• Mostly proprietary
8
Over The Air Updates
• Updates are delivered from OEM cloud directly to the vehicle
• Advantages
• Remote recall
• Lower cost
• Rapid deployment
9
ECU Flashing – OTA Update Manager
• Fetch updates from server
• Match hardware and software
• Cache update locally
• Connectivity isn’t guaranteed
• Flash individual ECUs
• In The Correct Order
• Harness existing classic solution (UDS)
• Or develop OTA specific interface
10
Design Security Considerations
11
Design Security Considerations
12
Authorization
• What permission do you need to update an ECU?
• How do you verify the authorization?
13
Authentication
• How to authenticate the backend?
• How to authenticate the vehicle?
• How can we ensure future proofing?
14
Integrity
• Where should the integrity checks happen?
• How is Key Management handled?
• How can we store updates securely?
15
Reliability
• Guarantee deterministic update result
• Testing preconditions
• Battery
• Safety
• Availability - User consent
16
Regulation
• Homologation
• How does this affect security updates?
• Compliance with UN R156
• RxSWIN
• Rollback
17
Misconceptions In Implementation
18
Misconceptions In Implementation
• Let's assume you have the perfect design
• You have written specifications and requirements
• These now need to be realized in code
• What can go wrong?
19
Simplified OTA Example
update_path = download_to_file("https://XXX.YYY/...", SWUPDATE_PATH);
// ....
if(verify_swupdate_package(update_path)) {
flash_firmware(update_path);
} else {
// ....
}
20
“The Server Is Always Authentic”
21
Insecure Backend Communication Example
update_path = download_to_file( "https://XXX.YYY/...", SWUPDATE_PATH);
// ....
if(verify_swupdate_package(update_path)) {
flash_firmware(update_path);
} else {
// ....
}
22
Insecure Backend Communication Example
update_path = download_to_file( "https://XXX.YYY/...", SWUPDATE_PATH);
// ....
if(verify_swupdate_package(update_path)) {
flash_firmware(update_path);
} else {
// ....
}
23
Insecure Backend Communication Example
string download_to_file(string url, string path) {
// ... Create X509_STORE
X509_STORE_set_verify_cb(store, verify_callback);
// ... Add certificates to store
// ... Perform download and writing to file
}
// Called on verification failure
int verify_callback(int ok, X509_STORE_CTX *ctx) {
return 1; // Ignore Error
}
24
Insecure Backend Communication Example
• Turns out the certificate chain is tested using OpenSSL
• A callback registered by the code is supposed to handle all errors
• In the implementation we examined the callback returned 1 for
most errors (no error)
• An attacker can supply an invalid certificate
25
Additional Cases
• Updates downloaded over HTTP
• Specific updates downloaded over HTTPS without verifying the
hostname in the certificate
• Update downloaded from an FTP server
26
“Using A Signature Is Enough”
27
Broken Signature Example
update_path = download_to_file("https://XXX.YYY/...", SWUPDATE_PATH);
// ....
if(verify_swupdate_package(update_path)) {
flash_firmware(update_path);
} else {
// ....
}
28
Broken Signature Example
bool verify_swupdate_package(string path) {
unsigned char received_hash[SHA256_DIGEST_LENGTH];
unsigned char calculated_hash[SHA256_DIGEST_LENGTH];
// ... Read file contents into data and verify file length
memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH);
calculate_sha256(
calculated_hash,
data.data() + SHA256_DIGEST_LENGTH,
data.length() - SHA256_DIGEST_LENGTH);
return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH);
}
29
Broken Signature Example
bool verify_swupdate_package(string path) {
unsigned char received_hash[SHA256_DIGEST_LENGTH];
unsigned char calculated_hash[SHA256_DIGEST_LENGTH];
// ... Read file contents into data and verify file length
memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH);
calculate_sha256(
calculated_hash,
data.data() + SHA256_DIGEST_LENGTH,
data.length() - SHA256_DIGEST_LENGTH);
return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH);
}
30
Broken Signature Example
bool verify_swupdate_package(string path) {
unsigned char received_hash[SHA256_DIGEST_LENGTH];
unsigned char calculated_hash[SHA256_DIGEST_LENGTH];
// ... Read file contents into data and verify file length
memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH);
calculate_sha256(
calculated_hash,
data.data() + SHA256_DIGEST_LENGTH,
data.length() - SHA256_DIGEST_LENGTH);
return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH);
}
31
Broken Signature Example
bool verify_swupdate_package(string path) {
unsigned char received_hash[SHA256_DIGEST_LENGTH];
unsigned char calculated_hash[SHA256_DIGEST_LENGTH];
// ... Read file contents into data and verify file length
memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH);
calculate_sha256(
calculated_hash,
data.data() + SHA256_DIGEST_LENGTH,
data.length() - SHA256_DIGEST_LENGTH);
return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH);
}
32
Broken Signature Example
bool verify_swupdate_package(string path) {
unsigned char received_hash[SHA256_DIGEST_LENGTH];
unsigned char calculated_hash[SHA256_DIGEST_LENGTH];
// ... Read file contents into data and verify file length
memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH);
calculate_sha256(
calculated_hash,
data.data() + SHA256_DIGEST_LENGTH,
data.length() - SHA256_DIGEST_LENGTH);
return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH);
}
33
Broken Signature Example
• Hash is extracted from the file
• Hash is also calculated on file contents
• Hashes are compared
• No actual signature is checked
• Attacker can create a file which will pass this check
34
Additional Cases
• Skip signature check if no signature is present
• CRC32 checksum as signature alternative
• Hyundai default keys (Non-OTA) – by greenluigi1
35
“Local Storage Is Secure”
36
Insecure Storage Example
update_path = download_to_file("https://XXX.YYY/...", SWUPDATE_PATH);
// ....
if(verify_swupdate_package(update_path)) {
flash_firmware(update_path);
} else {
// ....
}
37
Insecure Storage Example
update_path = download_to_file("https://XXX.YYY/...", SWUPDATE_PATH);
// ....
if(verify_swupdate_package(update_path)) { // First Read, Time-Of-Check
flash_firmware(update_path); // Second Read, Time-Of-Use
} else {
// ....
}
38
Insecure Storage Example
• File is read twice
• First for verification
• Then for flashing
• File can be changed in between being read
• Requires some way to manipulate the file
• Assume pre-existing limited code execution
39
Additional Cases
• OTA files stored in unencrypted storage
• OTA files accessible by other processes
• Tesla GTW storage on SD Card – Blackhat USA 2017 – Tencent
KeenLab
40
Suggestions For Process Improvement​
41
Suggestions For Process Improvement​
42
Design
• Don’t reinvent the wheel
• Learn from OTA in other industries
• Write detailed requirements
• Avoid mechanism duplication
• Share design across ECUs
43
Implementation
• Make no assumptions
• Follow best practices
• Defensive programming and multi-layered security
• Use comprehensive testing suites, static analysis, and fuzzing
• Share implementations across generations and variants
• Perform code reviews and penetration tests
44
General
• Standardization of software updates (AUTOSAR?)
• Open-Source reference designs and implementations
• Share your experience with the community
45
Special Thanks
• CYMOTIVE
• Ilay Levi (Security Researcher)
• Ruben Bokobza (Vehicle Security Team Lead)
• Dan Givon (HW Specialist Team Lead)
• Gal Zaban (Security Researcher @ Armis)
46
Questions?
47
cymotive.com
References And Further Reading
• Hyundai default keys (Non-OTA) – by greenluigi1
• Tesla GTW storage on SD Card – Blackhat USA 2017 – Tencent
KeenLab
• Cybersecurity of Firmware Updates - 2020 - NHTSA
• Secure OTA Software Updates in Connected - 2019 - (Halder,
Ghosal, Conti)
• Introduction to UN Regulation No 156 and the Software Update
Management System - Tobias Pilz
• Uptane project - Linux Foundation
49

More Related Content

What's hot

Principles of a vehicle infotainment platform - Hans-Ulrich Michel, BMW
Principles of a vehicle infotainment platform - Hans-Ulrich Michel, BMWPrinciples of a vehicle infotainment platform - Hans-Ulrich Michel, BMW
Principles of a vehicle infotainment platform - Hans-Ulrich Michel, BMW
mfrancis
 

What's hot (20)

Webinar - Automotive SOC - Security Data Analytics for Connected Vehicles
Webinar - Automotive SOC - Security Data Analytics for Connected VehiclesWebinar - Automotive SOC - Security Data Analytics for Connected Vehicles
Webinar - Automotive SOC - Security Data Analytics for Connected Vehicles
 
Software defined vehicles,automotive standards (safety, security), agile cont...
Software defined vehicles,automotive standards (safety, security), agile cont...Software defined vehicles,automotive standards (safety, security), agile cont...
Software defined vehicles,automotive standards (safety, security), agile cont...
 
Automotive Cybersecurity Best Practices
Automotive Cybersecurity Best PracticesAutomotive Cybersecurity Best Practices
Automotive Cybersecurity Best Practices
 
Flash Bootloader Development for ECU programming
Flash Bootloader Development for ECU programmingFlash Bootloader Development for ECU programming
Flash Bootloader Development for ECU programming
 
Automotive embedded systems part5 v1
Automotive embedded systems part5 v1Automotive embedded systems part5 v1
Automotive embedded systems part5 v1
 
Understanding UNECE WP.29 regulations on cybersecurity
Understanding UNECE WP.29 regulations on cybersecurityUnderstanding UNECE WP.29 regulations on cybersecurity
Understanding UNECE WP.29 regulations on cybersecurity
 
TARA- Automotive Cybersecurity.pptx
TARA- Automotive Cybersecurity.pptxTARA- Automotive Cybersecurity.pptx
TARA- Automotive Cybersecurity.pptx
 
ISO 26262: Automotive Functional Safety
ISO 26262: Automotive Functional SafetyISO 26262: Automotive Functional Safety
ISO 26262: Automotive Functional Safety
 
Vector red bend_webinar_flashing_over_the_air_and_delta_technology_20140121_en
Vector red bend_webinar_flashing_over_the_air_and_delta_technology_20140121_enVector red bend_webinar_flashing_over_the_air_and_delta_technology_20140121_en
Vector red bend_webinar_flashing_over_the_air_and_delta_technology_20140121_en
 
How to Apply Functional Safety to Autosar ECU's
How to Apply Functional Safety to Autosar ECU'sHow to Apply Functional Safety to Autosar ECU's
How to Apply Functional Safety to Autosar ECU's
 
ECU Flashing: Flash Bootloaders that Facilitate ECU Reprogramming
ECU Flashing: Flash Bootloaders that Facilitate ECU ReprogrammingECU Flashing: Flash Bootloaders that Facilitate ECU Reprogramming
ECU Flashing: Flash Bootloaders that Facilitate ECU Reprogramming
 
Cyber Security for the Connected Car
Cyber Security for the Connected Car Cyber Security for the Connected Car
Cyber Security for the Connected Car
 
Principles of a vehicle infotainment platform - Hans-Ulrich Michel, BMW
Principles of a vehicle infotainment platform - Hans-Ulrich Michel, BMWPrinciples of a vehicle infotainment platform - Hans-Ulrich Michel, BMW
Principles of a vehicle infotainment platform - Hans-Ulrich Michel, BMW
 
WEB ve MOBİL SIZMA TESTLERİ
WEB ve MOBİL SIZMA TESTLERİ WEB ve MOBİL SIZMA TESTLERİ
WEB ve MOBİL SIZMA TESTLERİ
 
Android pentesting
Android pentestingAndroid pentesting
Android pentesting
 
Harman automotive cybersecurity business overview
Harman automotive cybersecurity business overviewHarman automotive cybersecurity business overview
Harman automotive cybersecurity business overview
 
The Internet of Cars - Towards the Future of the Connected Car
The Internet of Cars - Towards the Future of the Connected CarThe Internet of Cars - Towards the Future of the Connected Car
The Internet of Cars - Towards the Future of the Connected Car
 
ISO-26262-Webinar.pptx
ISO-26262-Webinar.pptxISO-26262-Webinar.pptx
ISO-26262-Webinar.pptx
 
Automotive Security (Connected Vehicle Security Issues)
Automotive Security (Connected Vehicle Security Issues)Automotive Security (Connected Vehicle Security Issues)
Automotive Security (Connected Vehicle Security Issues)
 
Connected & Driverless vehicles: the road to Safe & Secure mobility?
Connected & Driverless vehicles: the road to Safe & Secure mobility?Connected & Driverless vehicles: the road to Safe & Secure mobility?
Connected & Driverless vehicles: the road to Safe & Secure mobility?
 

Similar to Automotive OTA Security For The Connected Vehicle (ASRG Secure Our Streets 2022)

Comptia a-220-902-exam-objectives
Comptia a-220-902-exam-objectivesComptia a-220-902-exam-objectives
Comptia a-220-902-exam-objectives
Paulo R
 
Acceleration_and_Security_draft_v2
Acceleration_and_Security_draft_v2Acceleration_and_Security_draft_v2
Acceleration_and_Security_draft_v2
Srinivasa Addepalli
 

Similar to Automotive OTA Security For The Connected Vehicle (ASRG Secure Our Streets 2022) (20)

Early Software Development through Palladium Emulation
Early Software Development through Palladium EmulationEarly Software Development through Palladium Emulation
Early Software Development through Palladium Emulation
 
Oracle_Patching_Untold_Story_Final_Part2.pdf
Oracle_Patching_Untold_Story_Final_Part2.pdfOracle_Patching_Untold_Story_Final_Part2.pdf
Oracle_Patching_Untold_Story_Final_Part2.pdf
 
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
Developing for Industrial IoT with Linux OS on DragonBoard™ 410c: Session 4
 
DevSecOps: Key Controls to Modern Security Success
DevSecOps: Key Controls to Modern Security SuccessDevSecOps: Key Controls to Modern Security Success
DevSecOps: Key Controls to Modern Security Success
 
Boris Stoyanov - Troubleshooting the Virtual Router - Run and Get Diagnostics
Boris Stoyanov - Troubleshooting the Virtual Router - Run and Get DiagnosticsBoris Stoyanov - Troubleshooting the Virtual Router - Run and Get Diagnostics
Boris Stoyanov - Troubleshooting the Virtual Router - Run and Get Diagnostics
 
System Administration: Introduction to system administration
System Administration: Introduction to system administrationSystem Administration: Introduction to system administration
System Administration: Introduction to system administration
 
Alexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implementAlexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implement
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxThe Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
 
Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18
 
CompTIA Cybersecurity Analyst Certification Tips and Tricks
CompTIA Cybersecurity Analyst Certification Tips and TricksCompTIA Cybersecurity Analyst Certification Tips and Tricks
CompTIA Cybersecurity Analyst Certification Tips and Tricks
 
W982 05092004
W982 05092004W982 05092004
W982 05092004
 
EFI Secure Key
EFI Secure KeyEFI Secure Key
EFI Secure Key
 
Comptia a-220-902-exam-objectives
Comptia a-220-902-exam-objectivesComptia a-220-902-exam-objectives
Comptia a-220-902-exam-objectives
 
Cloud native development without the toil
Cloud native development without the toilCloud native development without the toil
Cloud native development without the toil
 
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
 
VMworld 2013: Failsafe at PCIe Level: Enabling PCIe Hot Swap
VMworld 2013: Failsafe at PCIe Level: Enabling PCIe Hot Swap VMworld 2013: Failsafe at PCIe Level: Enabling PCIe Hot Swap
VMworld 2013: Failsafe at PCIe Level: Enabling PCIe Hot Swap
 
I got 99 trends and a # is all of them
I got 99 trends and a # is all of themI got 99 trends and a # is all of them
I got 99 trends and a # is all of them
 
Acceleration_and_Security_draft_v2
Acceleration_and_Security_draft_v2Acceleration_and_Security_draft_v2
Acceleration_and_Security_draft_v2
 
Agile and Continuous Delivery for Audits and Exams - DC Continuous Delivery M...
Agile and Continuous Delivery for Audits and Exams - DC Continuous Delivery M...Agile and Continuous Delivery for Audits and Exams - DC Continuous Delivery M...
Agile and Continuous Delivery for Audits and Exams - DC Continuous Delivery M...
 
Looking into trusted and encrypted keys
Looking into trusted and encrypted keysLooking into trusted and encrypted keys
Looking into trusted and encrypted keys
 

Recently uploaded

Top Rated Call Girls Mumbai Central : 9920725232 We offer Beautiful and sexy ...
Top Rated Call Girls Mumbai Central : 9920725232 We offer Beautiful and sexy ...Top Rated Call Girls Mumbai Central : 9920725232 We offer Beautiful and sexy ...
Top Rated Call Girls Mumbai Central : 9920725232 We offer Beautiful and sexy ...
amitlee9823
 
➥🔝 7737669865 🔝▻ Bhiwandi Call-girls in Women Seeking Men 🔝Bhiwandi🔝 Escor...
➥🔝 7737669865 🔝▻ Bhiwandi Call-girls in Women Seeking Men  🔝Bhiwandi🔝   Escor...➥🔝 7737669865 🔝▻ Bhiwandi Call-girls in Women Seeking Men  🔝Bhiwandi🔝   Escor...
➥🔝 7737669865 🔝▻ Bhiwandi Call-girls in Women Seeking Men 🔝Bhiwandi🔝 Escor...
amitlee9823
 
Madiwala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Madiwala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Madiwala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Madiwala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
amitlee9823
 
Escorts Service Rajajinagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Rajajinagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Rajajinagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Rajajinagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
如何办理麦考瑞大学毕业证(MQU毕业证书)成绩单原版一比一
如何办理麦考瑞大学毕业证(MQU毕业证书)成绩单原版一比一如何办理麦考瑞大学毕业证(MQU毕业证书)成绩单原版一比一
如何办理麦考瑞大学毕业证(MQU毕业证书)成绩单原版一比一
ozave
 
Vip Mumbai Call Girls Colaba Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Colaba Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Colaba Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Colaba Call On 9920725232 With Body to body massage wit...
amitlee9823
 
Majestic Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Majestic Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Majestic Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Majestic Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
amitlee9823
 
Top Rated Call Girls South Mumbai : 9920725232 We offer Beautiful and sexy Ca...
Top Rated Call Girls South Mumbai : 9920725232 We offer Beautiful and sexy Ca...Top Rated Call Girls South Mumbai : 9920725232 We offer Beautiful and sexy Ca...
Top Rated Call Girls South Mumbai : 9920725232 We offer Beautiful and sexy Ca...
amitlee9823
 
Call Girls Kadugodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Kadugodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Kadugodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Kadugodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
amitlee9823
 
➥🔝 7737669865 🔝▻ narsinghpur Call-girls in Women Seeking Men 🔝narsinghpur🔝 ...
➥🔝 7737669865 🔝▻ narsinghpur Call-girls in Women Seeking Men  🔝narsinghpur🔝  ...➥🔝 7737669865 🔝▻ narsinghpur Call-girls in Women Seeking Men  🔝narsinghpur🔝  ...
➥🔝 7737669865 🔝▻ narsinghpur Call-girls in Women Seeking Men 🔝narsinghpur🔝 ...
nirzagarg
 

Recently uploaded (20)

Top Rated Call Girls Mumbai Central : 9920725232 We offer Beautiful and sexy ...
Top Rated Call Girls Mumbai Central : 9920725232 We offer Beautiful and sexy ...Top Rated Call Girls Mumbai Central : 9920725232 We offer Beautiful and sexy ...
Top Rated Call Girls Mumbai Central : 9920725232 We offer Beautiful and sexy ...
 
➥🔝 7737669865 🔝▻ Bhiwandi Call-girls in Women Seeking Men 🔝Bhiwandi🔝 Escor...
➥🔝 7737669865 🔝▻ Bhiwandi Call-girls in Women Seeking Men  🔝Bhiwandi🔝   Escor...➥🔝 7737669865 🔝▻ Bhiwandi Call-girls in Women Seeking Men  🔝Bhiwandi🔝   Escor...
➥🔝 7737669865 🔝▻ Bhiwandi Call-girls in Women Seeking Men 🔝Bhiwandi🔝 Escor...
 
How To Fix Mercedes Benz Anti-Theft Protection Activation Issue
How To Fix Mercedes Benz Anti-Theft Protection Activation IssueHow To Fix Mercedes Benz Anti-Theft Protection Activation Issue
How To Fix Mercedes Benz Anti-Theft Protection Activation Issue
 
Dubai Call Girls R0yalty O525547819 Call Girls Dubai
Dubai Call Girls R0yalty O525547819 Call Girls DubaiDubai Call Girls R0yalty O525547819 Call Girls Dubai
Dubai Call Girls R0yalty O525547819 Call Girls Dubai
 
Madiwala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Madiwala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Madiwala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Madiwala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
 
Escorts Service Rajajinagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Rajajinagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Rajajinagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Rajajinagar ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
如何办理麦考瑞大学毕业证(MQU毕业证书)成绩单原版一比一
如何办理麦考瑞大学毕业证(MQU毕业证书)成绩单原版一比一如何办理麦考瑞大学毕业证(MQU毕业证书)成绩单原版一比一
如何办理麦考瑞大学毕业证(MQU毕业证书)成绩单原版一比一
 
Call Girls in Malviya Nagar Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts Ser...
Call Girls in Malviya Nagar Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts Ser...Call Girls in Malviya Nagar Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts Ser...
Call Girls in Malviya Nagar Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts Ser...
 
BOOK FARIDABAD CALL GIRL(VIP Sunny Leone) @8168257667 BOOK 24/7
BOOK FARIDABAD CALL GIRL(VIP Sunny Leone) @8168257667 BOOK  24/7BOOK FARIDABAD CALL GIRL(VIP Sunny Leone) @8168257667 BOOK  24/7
BOOK FARIDABAD CALL GIRL(VIP Sunny Leone) @8168257667 BOOK 24/7
 
How To Troubleshoot Mercedes Blind Spot Assist Inoperative Error
How To Troubleshoot Mercedes Blind Spot Assist Inoperative ErrorHow To Troubleshoot Mercedes Blind Spot Assist Inoperative Error
How To Troubleshoot Mercedes Blind Spot Assist Inoperative Error
 
What Causes BMW Chassis Stabilization Malfunction Warning To Appear
What Causes BMW Chassis Stabilization Malfunction Warning To AppearWhat Causes BMW Chassis Stabilization Malfunction Warning To Appear
What Causes BMW Chassis Stabilization Malfunction Warning To Appear
 
Vip Mumbai Call Girls Colaba Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Colaba Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Colaba Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Colaba Call On 9920725232 With Body to body massage wit...
 
(ISHITA) Call Girls Service Jammu Call Now 8617697112 Jammu Escorts 24x7
(ISHITA) Call Girls Service Jammu Call Now 8617697112 Jammu Escorts 24x7(ISHITA) Call Girls Service Jammu Call Now 8617697112 Jammu Escorts 24x7
(ISHITA) Call Girls Service Jammu Call Now 8617697112 Jammu Escorts 24x7
 
What Does The Engine Malfunction Reduced Power Message Mean For Your BMW X5
What Does The Engine Malfunction Reduced Power Message Mean For Your BMW X5What Does The Engine Malfunction Reduced Power Message Mean For Your BMW X5
What Does The Engine Malfunction Reduced Power Message Mean For Your BMW X5
 
Majestic Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Majestic Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Majestic Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Majestic Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
 
Top Rated Call Girls South Mumbai : 9920725232 We offer Beautiful and sexy Ca...
Top Rated Call Girls South Mumbai : 9920725232 We offer Beautiful and sexy Ca...Top Rated Call Girls South Mumbai : 9920725232 We offer Beautiful and sexy Ca...
Top Rated Call Girls South Mumbai : 9920725232 We offer Beautiful and sexy Ca...
 
John Deere Tractors 6130M 6140M Diagnostic Manual
John Deere Tractors  6130M 6140M Diagnostic ManualJohn Deere Tractors  6130M 6140M Diagnostic Manual
John Deere Tractors 6130M 6140M Diagnostic Manual
 
Call Girls in Malviya Nagar Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts Ser...
Call Girls in Malviya Nagar Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts Ser...Call Girls in Malviya Nagar Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts Ser...
Call Girls in Malviya Nagar Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts Ser...
 
Call Girls Kadugodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Kadugodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Kadugodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Kadugodi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 
➥🔝 7737669865 🔝▻ narsinghpur Call-girls in Women Seeking Men 🔝narsinghpur🔝 ...
➥🔝 7737669865 🔝▻ narsinghpur Call-girls in Women Seeking Men  🔝narsinghpur🔝  ...➥🔝 7737669865 🔝▻ narsinghpur Call-girls in Women Seeking Men  🔝narsinghpur🔝  ...
➥🔝 7737669865 🔝▻ narsinghpur Call-girls in Women Seeking Men 🔝narsinghpur🔝 ...
 

Automotive OTA Security For The Connected Vehicle (ASRG Secure Our Streets 2022)

  • 1. ©2022 CYMOTIVE Technologies Ltd. All Rights Reserved. Unauthorized use, duplication, disclosure or modification of this document is strictly prohibited. CYMOTIVE Technologies makes no representations regarding the correctness or completeness of the content herein. Benny Meisels 99% Complete, Don’t Turn Off Your Car Automotive OTA Security For The Connected Vehicle
  • 2. About Me • Benny Meisels • Lead Solution Architect @ CYMOTIVE • 9 years in IT and embedded security research • Enjoys working on electronic conference badges 2
  • 3. Motivation • OTA adoption is on the rise • Automotive OTA is complicated • Complexity == Harder to secure • We believe regulations are the “minimum requirements” 3
  • 4. Agenda • Classic And OTA Updates Intro • Design Security Considerations • Implementation Misconceptions • “The Server Is Always Authentic” • “Using A Signature Is Enough” • “Local Storage Is Secure” • And the resulting vulnerabilities • Suggestions For Process Improvement 4
  • 5. Classic And OTA Updates Intro 5
  • 6. ECU Update Objectives • Address recall / Fix issues • Safety • Compatibility • Usability • Security • Update function data (Maps, ...) • Add new features 6
  • 7. ECU Flashing – Classic Approach • Diagnostic tester • UDS (ISO 14229-1) over CAN • DoIP (ISO 13400-2) over Ethernet • USB 7
  • 8. ECU Flashing – Diagnostic Tester • Tester is connected to the OBD • Flashing SW uses the tester to send UDS messages according to the ISO 14229-1 standard • Mostly proprietary 8
  • 9. Over The Air Updates • Updates are delivered from OEM cloud directly to the vehicle • Advantages • Remote recall • Lower cost • Rapid deployment 9
  • 10. ECU Flashing – OTA Update Manager • Fetch updates from server • Match hardware and software • Cache update locally • Connectivity isn’t guaranteed • Flash individual ECUs • In The Correct Order • Harness existing classic solution (UDS) • Or develop OTA specific interface 10
  • 13. Authorization • What permission do you need to update an ECU? • How do you verify the authorization? 13
  • 14. Authentication • How to authenticate the backend? • How to authenticate the vehicle? • How can we ensure future proofing? 14
  • 15. Integrity • Where should the integrity checks happen? • How is Key Management handled? • How can we store updates securely? 15
  • 16. Reliability • Guarantee deterministic update result • Testing preconditions • Battery • Safety • Availability - User consent 16
  • 17. Regulation • Homologation • How does this affect security updates? • Compliance with UN R156 • RxSWIN • Rollback 17
  • 19. Misconceptions In Implementation • Let's assume you have the perfect design • You have written specifications and requirements • These now need to be realized in code • What can go wrong? 19
  • 20. Simplified OTA Example update_path = download_to_file("https://XXX.YYY/...", SWUPDATE_PATH); // .... if(verify_swupdate_package(update_path)) { flash_firmware(update_path); } else { // .... } 20
  • 21. “The Server Is Always Authentic” 21
  • 22. Insecure Backend Communication Example update_path = download_to_file( "https://XXX.YYY/...", SWUPDATE_PATH); // .... if(verify_swupdate_package(update_path)) { flash_firmware(update_path); } else { // .... } 22
  • 23. Insecure Backend Communication Example update_path = download_to_file( "https://XXX.YYY/...", SWUPDATE_PATH); // .... if(verify_swupdate_package(update_path)) { flash_firmware(update_path); } else { // .... } 23
  • 24. Insecure Backend Communication Example string download_to_file(string url, string path) { // ... Create X509_STORE X509_STORE_set_verify_cb(store, verify_callback); // ... Add certificates to store // ... Perform download and writing to file } // Called on verification failure int verify_callback(int ok, X509_STORE_CTX *ctx) { return 1; // Ignore Error } 24
  • 25. Insecure Backend Communication Example • Turns out the certificate chain is tested using OpenSSL • A callback registered by the code is supposed to handle all errors • In the implementation we examined the callback returned 1 for most errors (no error) • An attacker can supply an invalid certificate 25
  • 26. Additional Cases • Updates downloaded over HTTP • Specific updates downloaded over HTTPS without verifying the hostname in the certificate • Update downloaded from an FTP server 26
  • 27. “Using A Signature Is Enough” 27
  • 28. Broken Signature Example update_path = download_to_file("https://XXX.YYY/...", SWUPDATE_PATH); // .... if(verify_swupdate_package(update_path)) { flash_firmware(update_path); } else { // .... } 28
  • 29. Broken Signature Example bool verify_swupdate_package(string path) { unsigned char received_hash[SHA256_DIGEST_LENGTH]; unsigned char calculated_hash[SHA256_DIGEST_LENGTH]; // ... Read file contents into data and verify file length memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH); calculate_sha256( calculated_hash, data.data() + SHA256_DIGEST_LENGTH, data.length() - SHA256_DIGEST_LENGTH); return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH); } 29
  • 30. Broken Signature Example bool verify_swupdate_package(string path) { unsigned char received_hash[SHA256_DIGEST_LENGTH]; unsigned char calculated_hash[SHA256_DIGEST_LENGTH]; // ... Read file contents into data and verify file length memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH); calculate_sha256( calculated_hash, data.data() + SHA256_DIGEST_LENGTH, data.length() - SHA256_DIGEST_LENGTH); return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH); } 30
  • 31. Broken Signature Example bool verify_swupdate_package(string path) { unsigned char received_hash[SHA256_DIGEST_LENGTH]; unsigned char calculated_hash[SHA256_DIGEST_LENGTH]; // ... Read file contents into data and verify file length memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH); calculate_sha256( calculated_hash, data.data() + SHA256_DIGEST_LENGTH, data.length() - SHA256_DIGEST_LENGTH); return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH); } 31
  • 32. Broken Signature Example bool verify_swupdate_package(string path) { unsigned char received_hash[SHA256_DIGEST_LENGTH]; unsigned char calculated_hash[SHA256_DIGEST_LENGTH]; // ... Read file contents into data and verify file length memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH); calculate_sha256( calculated_hash, data.data() + SHA256_DIGEST_LENGTH, data.length() - SHA256_DIGEST_LENGTH); return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH); } 32
  • 33. Broken Signature Example bool verify_swupdate_package(string path) { unsigned char received_hash[SHA256_DIGEST_LENGTH]; unsigned char calculated_hash[SHA256_DIGEST_LENGTH]; // ... Read file contents into data and verify file length memcpy(calculated_hash, data.data(), SHA256_DIGEST_LENGTH); calculate_sha256( calculated_hash, data.data() + SHA256_DIGEST_LENGTH, data.length() - SHA256_DIGEST_LENGTH); return 0 == memcmp(calculated_hash, received_hash, SHA256_DIGEST_LENGTH); } 33
  • 34. Broken Signature Example • Hash is extracted from the file • Hash is also calculated on file contents • Hashes are compared • No actual signature is checked • Attacker can create a file which will pass this check 34
  • 35. Additional Cases • Skip signature check if no signature is present • CRC32 checksum as signature alternative • Hyundai default keys (Non-OTA) – by greenluigi1 35
  • 36. “Local Storage Is Secure” 36
  • 37. Insecure Storage Example update_path = download_to_file("https://XXX.YYY/...", SWUPDATE_PATH); // .... if(verify_swupdate_package(update_path)) { flash_firmware(update_path); } else { // .... } 37
  • 38. Insecure Storage Example update_path = download_to_file("https://XXX.YYY/...", SWUPDATE_PATH); // .... if(verify_swupdate_package(update_path)) { // First Read, Time-Of-Check flash_firmware(update_path); // Second Read, Time-Of-Use } else { // .... } 38
  • 39. Insecure Storage Example • File is read twice • First for verification • Then for flashing • File can be changed in between being read • Requires some way to manipulate the file • Assume pre-existing limited code execution 39
  • 40. Additional Cases • OTA files stored in unencrypted storage • OTA files accessible by other processes • Tesla GTW storage on SD Card – Blackhat USA 2017 – Tencent KeenLab 40
  • 41. Suggestions For Process Improvement​ 41
  • 42. Suggestions For Process Improvement​ 42
  • 43. Design • Don’t reinvent the wheel • Learn from OTA in other industries • Write detailed requirements • Avoid mechanism duplication • Share design across ECUs 43
  • 44. Implementation • Make no assumptions • Follow best practices • Defensive programming and multi-layered security • Use comprehensive testing suites, static analysis, and fuzzing • Share implementations across generations and variants • Perform code reviews and penetration tests 44
  • 45. General • Standardization of software updates (AUTOSAR?) • Open-Source reference designs and implementations • Share your experience with the community 45
  • 46. Special Thanks • CYMOTIVE • Ilay Levi (Security Researcher) • Ruben Bokobza (Vehicle Security Team Lead) • Dan Givon (HW Specialist Team Lead) • Gal Zaban (Security Researcher @ Armis) 46
  • 49. References And Further Reading • Hyundai default keys (Non-OTA) – by greenluigi1 • Tesla GTW storage on SD Card – Blackhat USA 2017 – Tencent KeenLab • Cybersecurity of Firmware Updates - 2020 - NHTSA • Secure OTA Software Updates in Connected - 2019 - (Halder, Ghosal, Conti) • Introduction to UN Regulation No 156 and the Software Update Management System - Tobias Pilz • Uptane project - Linux Foundation 49