Penetration Test Report (COMSATS_Islamabad-CyberSecurityLab): Threat Modeling Trinity Wallet

STRIDE/DREAD Analysis
Threat Modelling of Trinity Wallet
M. Masoom Alam, PhD
Department of Computer Science
COMSATS University Islamabad
Table of Contents
Management Summary 2
Assets for the Trinity Wallet 3
Overview of the Trinity Wallet Architecture 3
Crumble the Trinity Wallet 5
Security Analysis per/Platform 14
Threat Ratings 19
​
Use of Threat-Model 19
Rating Priority (High, Medium & Low) 19
Using STRIDE-Model for Classification of Threats 20
Using DREAD-Model for Rating Risk 21
Procedure for DREAD-Model Risk Analysis 22
Conclusion 23
1
Management Summary
Trinity is a user-friendly IOTA wallet that has been in development for the past few
months. It serves as a base wallet for the IOTA cryptocurrency and due to the
decentralized nature of the IOTA platform, Trinity stores all user private information for
accessing funds on the device (Mobile and desktop).
Considering the data gathered for analysis, the probability of risk has been
determined by identifying the assets affected by different possible threats in the Trinity
wallet. Each risk has a different impact upon the respective asset. We have used
DREAD and STRIDE analysis for identification of threats and their risk rating in the
Trinity wallet.
Threat Risk Modelling mainly comprises the following steps:
​
1. Identifying security objectives
2. Breaking down application features
3. Identifying threats and vulnerabilities
Identifying security objectives of the Trinity wallet mainly involves analyzing:
​
1. Security of the sensitive information stored on device.
2. Review of the third party libraries used.
3. Quantifying the loss of reputation derived from the application being misused.
Breaking down application features involves decomposing the application into small
​
feature sets and categorizing/prioritizing them. The goal of this step is to identify the
security impact, evaluated on the basis of data flow, entry points, components and
boundaries. The cross platform nature of the Trinity wallet and its dependencies is
analyzed thoroughly as some features are more secure if built natively.
Identifying threats involves formalizing known threats. This should include the risks
associated with using the application or a certain feature.
Our threat analysis is done in three stages:
1. Identify assets in Trinity: Identify trust boundaries, data flow, entry points,
​
privileged code and document the security profile.
2. Identify threats: Identification of threats in the Trinity wallet for Android, Linux,
​
Windows and iOS platforms
3. Rate threats: Rating threats using STRIDE and DREAD analysis.
​
2
Identification of Assets
Identifying critical assets is crucial for information security. A threat process for the
Trinity wallet is modeled as follows:
1. Assets for the Trinity wallet.
2. Overview of the Trinity Architecture.
3. Crumble Trinity wallet.
Assets for the Trinity Wallet
Trinity is a stateful wallet which means it stores client data. The most valuable data
that the Trinity wallet stores is the seed, balance information, and transaction metadata.
To ensure security, the user’s seed is encrypted with two layers of AES encryption.
The valuable assets of user that wallet stores are:
● The seed, a string of 81 random characters using A-Z or number 9. [A-Z or 9].
● Balance information, which describes the amount of IOTA owned by the user.
● Public addresses, which are used to receive payments.
● Transaction metadata.
Overview of the Trinity Wallet Architecture
During this step, the following activities are performed
● What can Trinity do?
● Diagram for an overview of the Trinity architecture.
● Technology stack of the Trinity Wallet.
What can Trinity Wallet do?
Trinity offers several unique services that make it one of the most promising
​ ​
candidates for a user-friendly wallet. The IOTA community is growing swiftly, and there
has been an increase in the number of non-technical users. Users are exasperated
following snapshots, when they have to reattach addresses until their balance is
recovered. To combat this situation, Trinity wallet provides an automatic balance
recovery feature. Another nuisance of the current IOTA wallet is that users have to do
manual reattachment or promotion if a transaction is pending for a while. The Trinity
wallet performs automatic reattachment and promotion under the hood to make the
wallet user-friendly.
Trinity wallet provides two factor authentication to combat the risk of theft. This feature
creates an additional level of security because solely knowing the victim’s password is
3
not enough to gain access to account. Trinity wallet also allows its users to scan
addresses via QR codes for convenience.
Here are some unique features that distinguish Trinity wallet from the current official
IOTA wallet:
● Statefulness: stores data locally and thus improves efficiency of the wallet.
​
● Transaction auto-promotion/reattachment : to increase the probability of
​
transaction confirmation.
● Two factor authentication: achieved with Google Authenticator and Authy using
​
Time-based One time Passwords (TOTP).
● Fingerprint authentication: A user can use mobile device fingerprint scan for
​
authentication after first login.
● Multi seed support: multiple seeds can be stored and managed.
​
● QR scanning: the Trinity wallet allows users to scan QR codes when entering
​
IOTA addresses.
The Trinity wallet accesses locally stored data at login since it is stateful wallet. The
data obtained from full nodes by Trinity is secured by the HTTPS protocol.
Figure:1 The Trinity Architecture Diagram
​
Technology/Platform Implementation Details
Electron An open source framework for the
development of desktop applications.
React Native/ React framework A javascript library for the development of
mobile applications.
Table:1 Technology of the Trinity Wallet
​ ​
4
Crumble the Trinity wallet
In the next section we discuss the following aspects of the Trinity wallet:
● The trust boundaries.
● The data flow.
● The entry points.
● The privileged code.
● The security profile.
Boundaries of Trinity Wallet can be Trusted
The Trinity wallet validates the user-provided data at all entry points. Itvalidates
​
user-provided addresses to check whether an address is of the required length: 81
trytes (non-checksum) or 90 trytes (checksum). The IOTA protocol works on trinary
logic, so wallet functions check if the user-provided trytes are valid. Valid trytes are [9,
​ ​
A-Z]. Before creating the transaction, the wallet checks if the user-provided amount is
​
an integer quantity of IOTA.
The other functions for validating data at entry points to Trinity are isNum, isHash,
​ ​ ​ ​
isTransferArray, isArrayofHashes, isArrayofTrytes, isArrayofAttachedTrytes,
​ ​ ​ ​ ​ ​ ​
isArrayofTxObjects, isInputs, isString, isArray, isObject and isUri.
​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​
Data Flow
At the login, the IOTA stateless wallet generates addresses from index 0 upto the
index of the last unspent address. That’s why it takes a long time to login. However, the
Trinity wallet is stateful. At login, it utilizes the locally stored data to provide user
transaction history, balance information etc. When a user requests to generate a new
receiving address, the wallet gets the latest address index from the data stored locally.
The wallet then generates addresses and checks for associated transactions, before
displaying the latest unspent address.
Entry Points
The entry point for a user is the password only. The user can access the wallet only if
​
they have the valid password. The entry point for a user can also act as the entry point
for attacks. An attacker can only access the user's seed if he has the valid password
only. However, Trinity wallet hardens the security around the entry point by offering two
factor authentication.
Privileged Code
The wallet requires permission to access the camera to scan QR codes.
5
Security Profile
1
The following table answers what kinds of questions can be asked while analyzing
each aspect of the des