 Hello, everybody. My name is Byung-chul Yu. I'm honored to be here to talk to you. I wish I was able to talk to you guys in person, but unfortunately, because of the pandemic, I decided to give you this presentation online. So, let's get into today's topic. I'm going to talk about real secure element really help strengthen the security of cryptocurrency wallets. First, let me introduce myself. My name is Byung-chul Yu. I'm a master's student at School of Cybersecurity in Korea University. I have six years' experience of working as a security software engineer. And I also a developer of T-Wallet Touch hardware wallet, which is an NFC-enabled car type cord wallet. My research interests include security engineering, blockchain, cryptocurrency, and IoT security. And Seung-joo Kim, the corresponding author. He has been a professor at the School of Cybersecurity in Korea University since 2011. He's a head of the same lab, an advisor of undergraduate hacking club, SICOR, a founder-director of an international security and hacking conference, SICU Insight. And he has been a review board member of Black Hat Asia since 2018. His research interests lie primarily in building inherently secure, high assurance, and provably secure system and architectures, and composable and scalable secure systems. Here's a table of contents. Firstly, in introduction, I'll give you a brief introduction about what I'm going to talk through today. Secondly, in threat modeling, I'll talk about what threat modeling is and the threat modeling methodology we use. Thirdly, in risk measurement, I'll talk about risk measurement methodology we developed and show you how to measure the risks of cryptocurrency wallets. Fourthly, in risk assessment result, I'll show you the result of risk assessment on cryptocurrency wallets and I'll compare the risks between the wallets. And finally, in conclusion, I'll give you a summary of our research and my final thoughts. Now, this is introduction. Here's a graph that shows the value of cryptocurrency hacks and thefts worldwide from 2016 to 2020. As you can see, it kept rising from 2016 to 2018 and it has been considerably dropped in 2019. But it keeps rising again. So, cryptocurrency hacking threats are prevalent across the globe at the moment. So, what do we need then? We need a safe and secure cryptocurrency wallet like LaserNanoS. And this wallet has even a secure element in it. So, what is a secure element? A secure element is a chip that is protected from unauthorized access and used to run a limited set of applications as well as store confidential and cryptographic data. So, basically, it is a security chip that protects your private keys from various hacking attacks. Now, let's look at the post written on Reddit last year. This user bought a LaserNanoS two years ago and he stored these cryptocurrencies in it. However, when he opened this wallet after two years with the expectation to see a great increase in price, he was very disappointed because all his cryptocurrency assets were stolen already. So, why did this happen? Even when he used a hardware wallet with a secure element? Some of you might have already guessed what happened to his wallet. And I'll talk about this post at the end of this presentation. In this research, we assessed the risks of cryptocrats' wallets quantitatively and compared the results to see which wallet is the most secure. And we'll see a comparison between hardware wallets and software wallets and also between a secure element wallet and a non-secure element wallet. Here's an overview of the risk assessment methodology we use. Firstly, the threat modeling phase, the cryptocrats' wallet system will be represented with data flow diagrams. And then, we identify threats from the data flow diagrams using the stride methodology. After that, we'll create attack trees based on the identified threats from which we can derive security requirements. And secondly, the risk measurement phase will analyze six cryptocrats' wallets on the market using the security requirements checklist we derived. And then, we'll convert the attack trees created in the previous phase into a Bayesian network from which we can measure the risks of the wallets using CVSS and other risk assessment factors. Now, this is threat modeling. So what is threat modeling? Threat modeling is a structured process to identify threats in the system and derive security requirements efficiently. When a bug or vulnerability is found in a product, it can be traced all the way back to the design phase. Therefore, it provides traceability. Threat modeling is being widely used by many big tech companies such as Microsoft, Apple, Google, Amazon, IBM, etc. On the left is a cord wallet system. It has a wallet manager application and a hardware wallet device. And on the right side is a data flow diagram. A data flow diagram, or a DFD, consists of external entities, processes, data flows, data stores, and trust boundaries. The DFD here is lever zero DFD of the cord wallet system. A DFD is written differently depending on the degree of abstraction. Lever zero represents the target system in its most abstract form. The higher the lever, the more specifically the system is modeled. As you can see, on the left is lever one DFD and on the right is lever two DFD of a cord wallet. The more detailed, the more accurate the Threat modeling wizard will be. Therefore, the lever two DFD should be as detailed as possible. Since a hard wallet system is different from a cord wallet system, we also created DFDs for a hard wallet system. So, here's the lever zero DFD of a hard wallet. As you can see, we created the lever one DFD and the lever two DFD of a hard wallet, as we did for a cord wallet. On a tech library, it's an archive of known attack factors and vulnerabilities that could break the target system. The attack library was created by referring to journals, conferences, books, CVE, CAPEC, and so on. We collected a total of 39 attack factors from the various sources, and they are listed on the attack library. And the attack factors are characterized by their characteristics. You can easily find out where they are referenced from by looking at the title and author of the source in the attack library. We use the Stride methodology, which is developed by Microsoft, as is the most well established among various available threat modeling methodologies. Stride identifies possible threats to each element of the system, from the attacker's perspective, based on six types of threats, which are spoofing, tampering, repudiation, information disclosure, and elevation of privilege. This enables systematic identification of the threats present in the target system. The Stride analysis procedure is as follows. Based on the attack library we created, we identified possible threats for the six types of stride targeting or elements of the TFDs of the system. For example, in the data flow diagram on the right, the user can recover a wallet by entering a recovery phrase into a device. However, if a key-logger malware attack is executed while the user is entering the recovery phrase, an attacker can steal cryptocurrency by deriving the private key from the recovery phrase installed. Therefore, the information disclosure threat is identified from the recovery phrase data flow element in the TFD. With the possibility, the key-logger malware attack, which is listed on the attack library on the left side. In this manner, we completed the stride analysis for the court wallet and hard wallet systems. And as a result of the analysis, a total of 103 threats were identified for a court wallet and a total of 112 threats were identified for a hard wallet. An attack tree was first proposed by Bruce Schneier. It is a threat modeling method that can systematically derive various attack paths for a target system. We create attack scenarios to achieve each goal of the attack trees based on the threats identified from the previous stride analysis. In this attack tree, on the top, there's a final attack goal that an attacker tries to achieve in the end. And in the middle, there is a branch node that is required to achieve their parent node. At the bottom, there are leaf nodes, which are the starting points in the attack path. The leaf nodes are the threats that were identified from the stride analysis. We divided the final attack goals into three main categories, which are stealing cryptocurrency, denial of service, and privacy breach. As for stealing cryptocurrency, an attacker could obtain a privacy so that it takes full control of the user's asset, or just simply deceive a user to send their cryptocurrency to the attacker's account address. As for denial of service, an attacker could delete the privacy stored in the user's device, or prevent the wallet accessing the blockchain network. And as for privacy breach, an attacker could obtain a user's personal identity information or the user's account address. This is the attack tree created for the three attack goals. As a result, a total of 187 threat nodes were created for stealing cryptocurrency. And a total of 62 threat nodes were created for denial of service. And a total of 86 threat nodes were created for privacy breach. Now, this is risk measurement. What is a Bayesian network? A Bayesian network is a probability graph model with a directed acyclic graph structure. Each node of the Bayesian network represents a random variable, while the directional edges connecting different nodes represent the conditional dependencies between the random variables. Using a Bayesian network, it is possible to make probabilistic Bayesian inferences based on the given evidence. For example, one can calculate the probability of having a specific disease when certain symptoms appear. Therefore, Bayesian networks are widely used in various fields such as artificial intelligence and medicine for disease diagnosis. And they are especially useful in the cybersecurity field for threat detection and spam filtering. Let's look at the example here. As you can see, there are four nodes and they are connected by four directed edges. With this Bayesian network, you can calculate the probability of wet dress, given the evidence such as if the weather is cloudy or not, and in the same manner. You can apply this method to calculate the probability of an attack depending on whether a threat has occurred or not. So, to calculate the probabilities of the attacks in the attack trees, we need to convert the attack trees into a Bayesian network. And here's how to do the conversion. Let's look at the picture. On the left are attack trees and on the right are converted Bayesian networks. As you can see, the parent-child relationship is reversed after conversion and each node A, B and C represents a Bernoulli random variable with a value of 1 indicating that the corresponding threat has occurred and a value of 0 indicating that the corresponding threat has not occurred. Looking at the conditional probability table, in the case of an OR operation, the probability that the value of the child node will be 1 becomes 1.0 if the value of 1 or more parent nodes is 1. In this case, if the node B or C occurs, then the probability of the node A will occur becomes 1.0. And in the case of an AND operation, the probability the value of the child node will be 1 becomes 1.0 only if the values of all parent nodes are 1. In this case, if the node B and C both occur, then the probability of the node A will occur becomes 1.0. Unlike an attack tree and a Bayesian network, different child nodes can have the same parent node, which means you can combine the same threat nodes from different attack trees. For example, even strapping input data using a key-logger malware can lead to obtaining a private key or obtaining user account information, which again can lead to stealing cryptocurrency or privacy breach respectively. A root node, which is a node without any parent nodes, has a prior probability distribution. A prior probability is unconditional probability that is assigned before any relevant evidence is taken into account. And it is usually decided by statistical data or expert knowledge. But what if there is not enough statistical data how to assign prior probabilities for root nodes? To calculate prior probabilities without statistical data, a total of 12 standards that are commonly mentioned in papers related to risk management or risk assessment frameworks were referenced, as you can see. Among them, we selected seven standards that provide criteria for risk assessment. Although it is not a risk assessment standard, the attack potential factor, which is used to calculate the attack potential of a given vulnerability in the CC evaluation, was added. And the results are shown in this table. We used the CVSS exploitability metrics as the basic metrics to calculate the prior probability of threat occurrence. The exploitability metrics of CVSS indicate the likelihood of a vulnerability occurring, and criteria for calculating each metric value have been developed. In addition, since each metric has a value between 0 and 1, it can be used to calculate joint probability when it is assumed to be a probability value. Therefore, we used the CVSS exploitability metrics as the basic metrics to calculate the prior probability of each threat node. And we appended three more metrics, which are derived from the risk assessment standards we selected before. And the results are shown in this table. When you look at the table, the attack factor metric reflects the context by which an attack is executed. This metric value will be larger, the more remote. The excess complexity metric describes the conditions beyond the attacker's control that must exist in order to execute an attack. The privilege-required metric describes the level of privileges an attacker must possess before successfully executing the attack. The user interaction metric captures the requirement for a human user other than the attacker to participate in the successful compromise of the target component. The time complexity metric indicates how much time complexity is required for an attack to be successful given that the attack can be performed. The expertise metric represents the level of expertise for competence the attacker must possess. Lastly, the equipment metric represents the level of equipment or software required for an attack. We use this formula to calculate prior probabilities. For example, let's assume T1 is a threat that installs a malware by social engineer. As for T1, the system can be attacked remotely and the attack can easily be reproduced. A user interaction is required to download the malware. Therefore, based on its characteristics, the prior probability of T1 is calculated as 0.30 and T2 is a threat that bypasses user authentication by fourth injection. As for T2, it is difficult to reproduce this kind of attack. It usually takes several months or more to succeed and a high level of expertise and special equipment are required. Therefore, based on its characteristics, the prior probability of T2 is calculated as 0.03 and what if security controls are applied in this system? Let's assume we blocked external internet access and embedded a secure element in the system. Because the device is separated from the external network, the T1 threat is limited to the local network. So the attack factor metric is changed to local. Also, since the amount of contact between the system and the outside world is reduced, conditions for performing the attack are more difficult so the access complexity metric is changed to high. Therefore, the probability of T1 is calculated as 0.11 and as the system's physical security is strengthened by the use of a secure element, the attack time of T2 increases so the time complexity metric is changed to extreme and the equipment metric is changed to bespoke because a more specialized attack equipment is needed. Therefore, the probability of T2 is calculated as 0. In this manner, we can calculate the prior probabilities of the threats differently according to what kinds of security controls are applied in the system. Therefore, different systems have different probabilities of a successful attack. In order to measure the risk of each wallet, we calculate the probability of each goal of the attack trees. To this end, the joint probability is calculated using the conditional probability of 4 nodes in the path to each goal. Therefore, the joint probability of each goal node is calculated using the chain rule. As you can see, 4 conditional probabilities are changed until the root nodes and as for the root nodes, prior probabilities are used instead of a conditional probability. And the prior probabilities are calculated as we saw in the previous page. After that, by summing the joint probabilities obtained through the chain rule, the marginal probability of the attack goal will occur is calculated. This is an example of attack trees to a Bayesian network transformation. On the left are attack trees for 3 attack goals. And on the right is a converted Bayesian network. Each root node is assigned a prior probability which is calculated using the previous method I showed you. And each attack goal has a marginal probability that is calculated with the joint probabilities. Therefore, depending on what kinds of security controls are applied to the system, the marginal probabilities of the attack goals are calculated differently. We measure the risk of each attack goal using the generally known equation. The likelihood means here a marginal probability of an attack goal. And the impact is the scale of the damage that the attack goal inflicts on users. The financial and reputation factors which are derived from the 7 risk assessment standards are used to calculate the impact of each attack goal. To calculate the risk of each wallet, we need to know what kinds of security controls are applied to the system. To this end, we derive security requirements checklist using the attack trees we created before. In this checklist, the impacted node represents the nodes that are affected according to the security requirements. And the removed node represents a node that is removed according to the security requirements. Therefore, with this checklist reserved for each wallet, we can calculate the risk for each wallet accordingly. This is risk assessment wizard. We selected two types of chord wallet and four types of hot wallet. Among chord wallets, a ledger nano S and treasure 1 hardware wallet, which are the most popular worldwide, were selected for analysis. Among hot wallets, we selected and analyzed the bread and trust wallet from Bowmy Wallets and the copay and electron for PC wallets. And Android and Windows operating systems were selected as the OSes for the mobile and PC wallets respectively, as they are the most commonly used OSes worldwide. This wizard reveals whether the wallets on the market satisfy all security requirements based on the security requirements checklist. As a result, the ledger wallet was found to be the wallet... the ledger wallet was found to be the wallet that satisfies the most security requirements. All the software wallets are found to be generally vulnerable to malicious code attacks except for a trust wallet. In the trust wallet, security controls were applied and screen capture and clipboard data theft attacks. And in the copay wallet, since there is a function to register an email address to receive notifications for the account, there is a threat of privacy invasion. We evaluated the overall risk of each wallet by summing all the risks of each attack goal. Among the six wallets, the ledger NanoS has the lowest risk at 17.5 while the treasure one has the second lowest risk at 19.47. The average overall risk posed to software wallets is found to be 1.22 times greater than the risk opposed to hardware wallets. Therefore, we can conclude that hardware wallets are generally more secure than software wallets. The overall risk to the treasure one, which has a general-purpose MCU, is 1.11 times greater than that to the ledger NanoS with its built-in secure element. However, in the case of the treasure one, the risk of denial of service is relatively high due to the lack of backup function for recovery phrases, which greatly increases the overall risk. Therefore, considering that the risk to the treasure one is only 1.05 times greater than that to the ledger NanoS for stealing cryptocurrency, where the role of a secure element is the most important, we can conclude that use of a secure element does not significantly diminish the overall risk to the wallet. Then, why does a secure element has a low effect? As you can see, the average differ prior probabilities which are related to secure element are much lower than that that are not related to secure element. It means since the threat that a secure element can mitigate have already very low probabilities of occurrence, the mitigation effect after a secure element is applied is not very significant. On the other hand, other threats that are not related to secure element have relatively high differ prior probabilities. Therefore, they show greater mitigation effects when security controls are applied to them. This is conclusion. Hackers try easy and efficient ways if possible. As you can see, they don't need to go through a complex system when there's an easy way out, because there is no such thing as a fair play in the criminal world. They will do whatever they need to do to steal your cryptocurrency. Here's an example of an easy way to steal cryptocurrency. A user tries to send his cryptocurrency to another address. Maybe it's his crypto exchange address or other person's address. So he copies the destination address first and then he goes to his wallet, paste the destination address, and send it out. But what if there's a clipboard hijacker malware installed? As you can see, as soon as the user copies the destination address in the clipboard, the clipboard hijacker replaces it with a similar address. Since cryptocurrency address formats are usually very difficult for people to read, if the user does not pay much attention to that, he might send it to the attackers without noticing. And here's another easy way to steal cryptocurrency. Many people still store their recovery phrase screenshot image in their phone. And what if the user downloaded a malicious photo app which apparently looks innocent? The malware will ask for a mission to access photos and media. And then it starts searching for any recovery phrase screenshot in the phone. If the phone has no recovery phrase screenshot, it will wait until it has one. Once it finds a recovery phrase, all the assets are on the attackers' hands. Therefore, we need to focus on the easy and efficient ways first. Because the easier the way, the higher the risk will be. And after blocking all the easy ways, you need to focus on the complex ways. Therefore, a secure element should be the last priority. What is usable security? Usable security is the process of making security features usable, which is easy, convenient, and simple, and preventing security features from being misused. So here's what happened to the ledger and nano S user. He stored the recovery phrase in his email account in case he loses it. Therefore, even though he didn't use the wallet for two years, all his cryptocurrency assets were stolen because his email account might have been hacked. However, is it all his fault? As you can see, I append these some words at the bottom. If the recovery phrase were like this, would we still send the recovery phrase to his email account? Well, at least the user will easily understand that they should not store it in their email account, because it's not safe there. Of course, this is not compatible with BIP 39 standard. But the point here is that we need usable security that leads the user to use the wallet as intended safely. To make a safe and secure product, we need to do security by design. By doing so, we can identify threats as early as possible in the design phase, which can dramatically reduce cost per defect. Because the later the defect is found, the more cost and time are required to reserve. To this end, as we saw through this presentation, use threat modeling, secure SDLC, and risk management. And here are my final thoughts for you. Start threat modeling right now and apply it to your development life cycle. You can click the link below and start with the Microsoft threat modeling tool. And do quantitative risk assessment on your system using our methodology. Do threat modeling and risk measurement with a Bayesian network. And then prioritize the security requirements based on the risks of the threats. And for cryptocurrency wallet developers, as I said before, you need to focus on the easy ways first. So prevent a recovery phrase screenshot or clipboard copy. Prevent entering a recovery phrase directly from the keyboard. Maybe you can use a virtual keyboard and check if the phone is rooted or jailbroken. So this is the end of my presentation. If you have any questions as to this research, please contact us by emailing at the addresses here. So thanks for listening.