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

Loading player…

IT TAKES A VILLAGE - Shira Brezis

Ethereum DenverMon, Oct 9, 2023, 12:00 AM

Review of 2022 various attack vectors - from zero days to supply chain attacks and sophisticated social engineering, so we can better understand the cyber threat on web3 and how to defend against it. Important lessons for projects teams who need to understand they are a target and to plan accordingly as well as to traders who need to get the right tools to help them against the unknown. Shira Brezis Co founder and CEO Redefine Shira Brezis is the CEO and co-founder of Redefine. Founded in 2021, Redefine focuses on security technology for institutional users in the Defi space. Prior to that, Shira gained extensive cyber security experience working for the Israeli government for over a decade. She has been involved in the Crypto sphere since 2012, buying bitcoins for $200 each (still HODLing!). In 2018, she founded the FinTech labs in the technology department of the Israeli Prime Minister's office. Shira has a PhD. in the field of Law and Economics from The University of Chicago Law School and an MBA from the Hebrew University of Jerusalem, majoring in finance. She is fluent in valyrian. https://twitter.com/shirabar1

Transcript

run um I'm Shira from Moody fine and I'm here to talk to you about defy security so let's start with a quick question or a couple of questions please raise your hand if you ever made a swap on uni swap using a metamask wallet okay that's nice so it's gonna look like that right uh let's take it to the next level how about the programmatic swap using you know the unit swap contract directly no okay yeah anybody else cool let's try you guys one more time how about well it's going to look like that and then the byte code would look like that how about um supplying liquidity programmatically okay no no no no no no no no one okay so it would look like that and the bytecode would look like that but basically what I want to say here is that the more complicated it gets the more we tend to go through intermediary to accomplish what we want to do so we live in exciting times where people build crazy it gets more efficient more sophisticated more impressive but it also gets more complicated and as a result it's also harder to secure and we'll touch on that in a minute so let's go back to Classic crypto right when it wasn't so complicated when the only transaction we could do was the Bitcoin change from movie from A to B very simple very straightforward the Bitcoin blockchain is actually inherently secure because if you want to pull off a cyber security attack the first thing you do as an attacker you're looking for that one second point of failure that you can abuse where you can change something or tweak it or erase something but if you have a decentralized network like the Bitcoin blockchain for example then there is no one single point of failure whenever you're gonna touch something or change something the 99 of the network is going to be inconsistent with whatever it is you did and your attack will fail this is why we've never seen a successful attack on the Bitcoin blockchain so no one was ever able to erase the block or to add the block right the only things we've seen are attacks on the end point so an endpoint could be someone's wallet that's compromised but an endpoint could also be coinbase so it's a big thing the end point but this is not the network and there's good Solutions how to protect the endpoint on such a network and that's custody so we already got that sold right you have cold wallet and you have you know smart key management and multi-party computation and multi-seek you have all the technology out there and this problem is solved however now that we look at D5 and web3 in general now transactions have gone you know to the next level we don't want to just move Bitcoin from A to B we want a stake we want to borrow we want to Mint an nft we want to do flash loans right we want to do crazy things those things require code and the more complicated are the things we want to do the more complicated the code is going to be and I can tell you right now when there's code they're always going to be vulnerabilities always and more than that remember how we said The more complicated it is the more people will go through an intermediary so now here's your one second point of failure right there because uni swap is fully decentralized let's assume for a second their code is bulletproof no vulnerabilities it's not by the way I'm sure but even if it is if most of us are going through the web app or a website then we're not there this is not decentralized this is as centralized that it gets this is classic web 2 and then we are exposed to a lot of web 2 attacks and we'll talk about that as well so we have new problems and the old solution custody is no longer helping us fully so it's still very important obviously it probably covers about 50 percent of the the problems but there's a whole 50 that is not covered for two reasons the first one is because it doesn't matter if you have a bulletproof vault in your house if your money is not in it and in defy our money is not necessarily in our custody if you're sitting in a liquidity pool somewhere or you know somewhere you put your money on a smart contract or you're on a bridge Crossing headed anywhere I don't know somewhere else your money is not secured it doesn't matter what custody you have but even worse also the money that is in your very secured custody is at risk and the reason is but the way D5 works is by giving an approval you give an approval to a platform by giving an approval that means you're giving someone permission to reach into your super secure custody and do whatever it is you all agreed on that doesn't always work so well right because what we do and that's how we call it is blind signing people hit approve but they don't really know what they're approving most of the wallets today don't give you any Clarity on that you see some hexadecimal blob and you just hope to God that that's the right thing to do that's not a good way to transact imagine your bank would tell you transfer money to this random place maybe it's the right address maybe it's not let's see let's see how it goes right you wouldn't you wouldn't move money this way and so we're going to be talking a bit about that as well so this is how we got here with billions of dollars are being stolen from defy users actually sometimes the platforms themselves and they're they look different I mean there are many things they're flash loan attacking code exploit and compromised private keys and Oracle manipulation and fronted attacks and rug pull and fishing etc etc etc so what I want to do today is go over some of those attacks with you to just show you a bit on each one and what can we learn from them and how can we do better so I'll start with the badger dial because it's a very very basic one it's an old one also it's from December 21. the badger Dao the code was perfect there was no problem in the code this is a classic web to attack what we call front-end attack which means you attack someone on the supply chain you don't attack the platform itself specifically the badger though the attack um I don't remember it's here in the slide oh the cloudflare the cloudflare account was compromised anyway by making this compromise they were able the attacker was able to hand the users a malicious transaction to sign okay so there's a transaction that you used to sign this is an approval normally the approval will go by the way in approval this spender is always the most important thing who is the money going to right normally that would be a smart contract here the attacker was very lazy it was a very basic attack he just used this access he had to hand the users a malicious transaction by changing one thing he changed the spender to his own wallet so basically whatever you do now money goes straight to the attacker this is something that is easy to identify literally just go to etherscan and check the address of the spender one click you'll know if it's an eoa a wallet or if this is a smart contract and never ever ever give money to any away when you're on D5 that makes no sense another thing to remember here from this attack that even if you are on the right website that doesn't make it safe and that's a really important thing to remember because oftentimes we speak to a lot of customers and they say oh we don't need we have the firewall that's our product it's um kind of like an antivirus the first firewall in crypto between the wallet and the platform and sometimes people will say I don't need it because I only go to the you know Blue Chip platform something very known I don't take any risk I don't make any crazy defy uh Adventures but that doesn't help sometimes even the bright platforms are under attack let's move a little bit forward to see the evolution of the attackers so this is the convex attack It's actually an attack on several platforms at the same time because again it's a web to attack this is what it's called DNS poisoning so the DNS was hijacked through here the name chip through the registrar so that means you go to the right website but somebody's now changing the traffic taking you somewhere else because they compromise the third party this has nothing to do with the platform with a decentralized platform and now you get again somewhere where somebody's handing you a malicious transaction to sign but here the attacker was slightly more sophisticated so this is not now changing the spender to an AOA they're changing the spender to a different contract a smart contract just not the right one and they even make it look like the original legitimate contract the prefix in the suffix kind of look alike so if you're not careful and even if you remember the address this seems familiar to you and you will approve this transaction and then you're screwed so if you look at their attack again a bit more sophisticated than what we've seen before first of all those green known are the contracts that were used during the attack those are the malicious smart contracts that were deployed by the attacker if you go and do the research clustering and declustering the wallet you're able to see that they all came through tornado cash and that's always you know a good sign to know that you're in trouble because only an attacker who knows that eventually there's going to be an investigation will start from a mixer knowing that later on somebody's going to try to reveal the identity and by the way this is an interesting thing when we were we were researching this we found you see the yellow one we found a third contract this contract was not involved in the attack if you look at ether skin it is not listed it's not blocked nobody knows this contract actually we already reported it but before we found it nobody knew about that one this one is an attack waiting to happen it's the same attacker deployed a third one hasn't used it yet it's just sitting there waiting for the next attack one good thing to say here about the community and crypto Twitter people are fast to respond fast to report it's really crucial and important because even though when you're hacked and you go and Report you're already not able to stop an attack usually but you're able to mitigate it substantially because people are aware now and they're more careful so there was a person here who was very fast he says here I don't know what's happening but I'm not 100 sure this is okay and then convex retweeted and everybody was on alert so in terms of our takeaways what we do at redefine it's kind of like an anti-fraud system where we raise Flags so for example for this attack when you are going to say approval we would raise Flags there's a smart contract here it was funded by a mixer it was recently deployed it is unverified certain Flags together certain combinations will look to us like attacks we've seen before and with this is when we're going to say to the user do not sign this transaction and again I mentioned the early public response and the fact that we can find more ioc more indication of compromises from this attack learning for futures attack um this is another one A different one an oracle manipulation one so more complicated and more thought through I think this is an over collateralized Landing platform that was using a third party to get their information about pricing so it's a decentralized Oracle reporter and the third party what they're doing is they're letting people stake money in order to report and then people report prices so the attacker here very smart read the smart contract understood how to manipulate that decentralized Oracle together with a smart contract and did exactly that he's taked a lot of money he reported the pricing obviously the pricing was off the charts this way he was able to fool the platform The Lending platform and then he went there and he just borrowed a lot of money against it um I think 120 million stolen worse million dollars were still in this way here the user has very little to do it's mostly auditing right specifically I think for the Oracle company but also for the protocol and if you're using a third party as your Oracle you should understand their code as well and by the way if you look at oracles they're redundancy there are things to do in order you're not so dependent and you're not so relying so heavily on one source and of course monitoring which is what we build as well I'll say one more thing it's actually not in the slide but standardization so for us it's going to be much easier to secure for us I mean the entire Community who's dealing with security if there is standardization for the infrastructure nobody needs to invent the Oracle system every time nobody needs to invent a bridge in a different way every time there's there's an advantage to having some standards in the community and security is one of them okay one more I still have some time um this is a private key compromise so here the attacker stole the private keys of the deployer so by stealing the private keys he doesn't have access to money he has access to deploying a malicious contract but the contract looks exactly like the legitimate way of upgrading the original contract so so check this out for us as a security company when somebody puts their Spenders in eoa easy to spot even for a user when somebody puts a malicious contract now we come in and we need to raise some Flags but again it's not the end of the world in terms of the analysis but when somebody uses the legitimate way to upgrade a contract puts a malicious contract here it was a malicious token that was minting excessively it's very hard to spot the way we do it is with symbolic execution so we run a tool looking through the code reading the code looking for malicious logic this is a much more sophisticated way to identify an attack definitely not something a user normally does and of course custody custody custody this is here um on the platform I don't know what went wrong there but you as users the fact that it's not your custody to worry about I mean you cannot make sure somebody else is uh has good custody or manages their keys well so always you need to have uh on your end as well um your your tools we'll talk we'll talk a bit about that about what the users can do but don't rely on others to have good security it's just the same way when you go online and you you're going to go to amazon.com and you're like I don't need security because this is very secure no you're not going to go without an anti-virus right the same way in crypto never go without endpoint protection as a user I'm not going to go into that because we don't have time it's a really cool smart contract vulnerability check it on our website um it's very very interesting it's actually probably my favorite uh attack last but not least I couldn't not mention this one just because it's right here at home right so East Denver last week a malicious website was able to convince people uh to once they to visit the wrong website first which is just clear phishing and then connect the wallet quickly scans with a wallet if it's if they were taken one place if they had non-native token they were taken another place but either way the money was stolen from them and people lost 50 each they're someone specific like one user lost 44 eth on this transaction which is really really unfortunate so beware of phishing a tab never ever sign blindly use the firewall or any other product that could protect you when you transact and explain to you and give you Clarity what it is you're signing endpoint protection one last thing this is the community we should all work you together so each and every one of us has a role and each and every one of us can do something about security so if you're a wallet provider clearly custody is the most important thing but it's not enough you should give your users transaction analysis visibility risk assessment if you're working on a wallet or you already have a wallet come talk to me redefine would love to supply you with that as a very very good solution if you are a Dap You need to add it you need to use developer tools formal verification symbolic execution obviously Key Management have a bug Bounty verify your code make sure everybody can read it and look at it and give you a notice make it transparent if your infrastructure already mentioned standardization also have incident response plan in place and so on um find I mean security I already spoke we're providing all those tools but analytics I must mention because it's the bread and butter of risk management block explorers like etherskin Dex analytics like Dex screener we use bit queries Dune we use coin gecko use debunk all of those super helpful we could not have done this without them so we feel like the community is doing a lot to start fixing this problem we cannot scale without it and there are a lot of interesting projects that are you know helping the community and we want to do our part so we all want to have you know you celebrate defying peace and safety and this is going to be what we can do for you guys we're going to give our approval manager for free for the community if I can make this video work it's a one minute video let's see hey this is Jesse Jesse I'm super excited to introduce our new approval manager deprovals approvals are an inherent mechanism of defy if you're wanting to trade or do anything with the token you're going to have to give an approval to a spender and no matter how secure your custody is once a spender has your approval they're able to reach into your wallet and take tokens out of it so being able to understand what approvals you have active and being able to understand the risk associated with those approvals will equip you to be able to assess and mitigate these risks our approval manager was constructed by packaging our institutional grade security tools into something that we can give to the community to help better equip each and every one of you out there you're able to connect your wallet and you can view all of your active approvals across all the chains that we support as well as the risk assessment of each of those active approvals you'll then obviously have the ability to revoke those approvals and mitigate any risks that do exist we hope that this is helpful and just remember stay safe out there we got your back hey this is Jesse from thank you everybody stay safe

Automatic transcript — names and jargon may be misspelled.