New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Ethereum Security Overview

DevconMon, Oct 9, 2017, 12:00 AM

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more. https://archive.devcon.org/archive/watch/2/ethereum-security-overview Martin Swende gives an overview of Ethereum Security. Speaker(s): Martin Swende Skill level: Intermediate Track: Security Keywords: risk, loss, likelihood, impact, wallets, dapps, developers, network, isolation, tamper, hsm, vault, verified, randomness, audit, vm Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum Learn more about devcon: https://www.devcon.org/ Learn more about ethereum: https://ethereum.org/ Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. Devcon 2 was held in Shanghai, China on Sep 19 - 21, 2016. Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

Transcript

so uh Martin sanda going to talk about ethereum security so cool can we turn this a volume up a little bit please to start off with security it's like this big pretty vague term so what is it so when we talk about security is easier sometimes to think about risk and the risk is something which could potentially cause a loss a risk something a possible event which would be bad and typically the risk level depends on the likelihood of that bad thing occurring and the impacts if that bad thing did occur so if we want to reduce risk we can reduce the likelihood that the bad thing happens or we can reduce the impact if it occurs so we reduce risk that way we increase security common ways to do that is to separate things isolate them and apply several layers of Defense and some typical security concerns in the overall etherium ecosystem it's like and uses security when you have the wallets and interact with contracts and daps and also put developers how do I develop secure contracts and apps and on a macro scale the network security overall and these are all different security concerns and the threats they vary some of them are like game theoretical incentivization of miners or third exploits or protocol yeah stuff in the protocol which makes the communication between nodes lag stuff like that is very wide variety of threats and I'm gonna start with end users dealing with wallets so will you deal with wallets a good model for security is to isolate them have hot cold and frozen where hope wallet is what we'd use for everyday cash on your everyday computer interacting with that or whatever you do with your ether and then have a cold wallet which you would more consider your bank if you need more money in your wallet you take some money from the bank and put it in the hold and you would naturally need to backup of the cold wallets and that's what I call the frozen so then you have done the reduction you're done reduce the impact of the hot would compromise you reduce the likelihood of a cold wallet compromise and you do the impact in case you're cold wallets burns up and if you don't deal with wallets maybe you're having the money on an exchange which is perfectly fine if your money that you have accepted that you may lose you should not store more than you have then you can accept the risk of losing electronic wallets if you put together kind of a feature list of things that we want from a cold electronic wallet is that it should be safe to use with untrusted devices so if you're using an internet kiosk or your normal laptop has been compromised we don't want that to be able to compromise your cold wallets you should still be safe to use and if someone should steal it we wanted to resist key extraction typically by a race on tamper also HSM a secure element for all you techno maps traveling in the world is good if it's small enough to carry in your pockets you don't have to leave it in the hotel room there are some of these products coming up the legend on has been released truster is a Bitcoin wallet it's going they have announced the terraeum integration USB armory this is the generic computer the interesting part of it is that when you plug it in it spins up in your network interface so you can plug it in in USB and then you can SSH into it or will is an open-source secure computer and attempt at a secure computer it completely open and moving on frozen so the backup if you want to backup your cold wallet you want to do it securely you don't want the the seeds or the private key to be able to burn or get broken you could put it in the cloud cryptographic encrypted and I only have a very hard password which may not be a good idea because you can lose your memory or got hit by a car or something so one solution is to use something like the crypto steal and put it in a bank vault or take it down in the backyard in the outback or you can just maybe buy an old laptop this is a cheaper solution never let it touch the internet and then just print out the seeds and put it in the bank vault you can also use the Force we have ethereum so there are native tools Nick Johnson and who's going to present after me he's done an implementation I mean it's very involved which is a time lock so you can only use a certain amount at every predefined time period and that's you do that using your hotkey and then you also have the recovery key and you can only use that once and when you do use that it destroys the vault and sends all the ether to the recovery address so if the bad guy has got hold of your hotkey then you just nuke the vault and get the money back so you should store that recovery key in some kind of safe probe some backup there's also the multi-sig contract and you spread the trust across several people so in in the one of them you reduce the impact and the other you reduce likelihood if the likelihood of all them trusted people getting compromised and don't get hacked try not to get hacked you know ordinary laptop if you're running a minor remember that a minor is it's 24/7 connected to this network of potentially hostile peers I'm guessing it's most often unsupervised so don't put anything on value on it including your coin base it shouldn't be on the on the minor it should mind to the coin base somewhere else use virtual machines and firewalls and drop everything coming to your host which you're not originating just do sanity check or what you expose if you're developer you're probably exposing like your MySQL or a patchy or Tomcat or whatever limit that right interacting with contracts so a verified contract what does that mean it means that what is deployed on the blockchain there is a source code and it can be verify that the source code when compiled and deployed will correspond to that it doesn't mean anything more than that it doesn't mean that there's it has been audited by a third party or anything like that only that the source code is available some things to watch out for if you're interacting with the contract and have the source code is does it use randomness in any way shape or form and if it does where does that random come from and can the source of that random be gained and can anyone access it before you and in many cases they can so some sources of random that can be used are low caches it can be also important hashes from the bit boxing Maya BTC relay in which case there are a number of other people which can see the headers before before they actually get deployed on the East ether chain and even if the source of the random is some user on ethereum some game operator remember that the transaction goes out and then it takes 14 seconds before it's getting cluded in block so anyone can just use that information and from from that source so unless they are actually defined time slots for random and then acting on that random and it can probably be gamed you should also watch out for Sybil attacks so a civil attack is when an attacker is using several identities imagine that you're sitting at a poker table playing against five other people and what you don't know is that they're all colluding against you they're all the same person you should watch out for ragequitting so if you're using some kind of service which has several states which it moves between if the state transition depends on someone doing their part for example the operator providing the seeds for the next round or the operator cashing out what happens if he doesn't if it just stops or you see it can he suicide the contract and just collect the bank I'm going to taps so adapts I'm sure most of you know probably all of you HTML Javascript pages which have access to this web 3 API and they can interact interact with ethereum so that's reciting the browser it could be missed or parity based and the browser has an extensive attack service because the web is broken it's a centralized trust model based on the ca authority and mainly the browser tries to render things not based on specification is more like the specification to document what what we have there they've been specified post factum and there's no real governing security model for how anything is handled on the web so there are a lot of vulnerabilities and a lot of possible exploits so with that browser connects this broken web with your wallet so I would recommend don't couch surf the internet with your deaf browser and verify that resources are fit securely over HTTPS and when you're signing something in a DAP you should verify that the recipient address just actually correspond to the contract that you intend to interact with for building the apps the same applies use HTTPS that certificates as their strict Transport Security and tried not to use CDN content delivery network because that means that someone else is delivering code and if someone else can execute JavaScript on your DAP didn't it either because they can inject the traffic at where the client is sitting because you're not using HTTPS or because they're serving the content or because it's the cross-site scripting vulnerability it's like an execute JavaScript they can do whatever they want with the DAP and they can send the payments to another address and you should learn about web security if you're starting with our top ten and there are a lot more than I was a top ten but that's a good start so building contracts just as Java has mentioned a lot about this but all the thing in testing is very important you need to learn the inner workings of the VM unfortunately but also it's pretty easy to do so you can I'd recommend you to start with the VM source code of Python it's very small 600 lines of code and try to have an upgrade path and not only for the code in your contracts potentially also for all your data how do you move that into the next version of your contract as Joseph mentioned check the invariance escape hatches emergency brakes and try to make things foolproof so so even fools can use them and allow users to make errors so this is from one of the splinters after the hard work and what's highlighted here is 1,493 ether which has been successfully split into the zero address so someone who probably wanted to split away his etc' but keep his eth ether and didn't put anything in in that field so basically it became zero and all his ether went up in smoke and in total there's been about 1800 ether sent to the syrian rest by allah splitter right there are several vulnerabilities Josef's talks about most of them and i don't have time to go into them i'll mentioned some of them so not robust against Shane reordering that for example if you have a committee reveal scheme what could happen is that you commit and then comes the reveal phase and then the malicious minor rolls back and starts mining a step back and uses the information that has been revealed it starts a new version right there's a simple double function which tries to double the input you into eight and it puts it into you at 64 so it should be fine right but when we run the test and Sun in our X 80 it returns zero so you should learn the details of how solidity works if you want to make secure smart contracts there are several patterns also mentioned earlier and you should also think about that private networks are not really private okay they call private networks but that doesn't mean that that someone cannot come into them everything is center of them can be seen and studied and if you're using the original Genesis they might even be people who have access and can interact and have ether on that Private Network some final notes you should think about your risks and your exposures okay and your threats according to what you are doing and what your what your assets are and the way to increase security is to minimize the likelihood and the impacts and those minimize the risk and to do that you typically separate isolate and defend everywhere possible and harden your environment so I study the VM and learn solidity used best practices and if you worried about consensus issues on network attack just run several clients in parallel that's a big strength that we have in aetherium that there are so many different client versions so that one network attack touching would doesn't affect the whole network at once but only parts of the network try to build things that anyone can use not just us techniques there's lots of work going on which I would hope that more people get involved in here are a couple of discussions that are happening in the form of ethereum improvement protocol there's 134 and discussion about how we can prevent cross-chain replay attacks using by changing how transactions the fields in them that they're only valid after a particular hash 138 concerning the bomb 140 how can implement throw in a cheaper way 116 we can add a static call up code which would make it you could call a contract from a contract but that contract cannot modify it States so it would make reentrant attacks impossible well they can reenter but they can't modify the state while you're entering one or two make it possible to do ring signatures elliptic curve cryptography on chain and one one is one that I really like big into Earth Mattox would enable make it possible to the RSA cryptography and those PGP verification on chain so I urge you all to get involved in the ongoing discussion that's all for me thank you

Automatic transcript — names and jargon may be misspelled.