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

Loading player…

Attacking an L2 with Unbridled Optimism - Jay Freeman

Ethereum DenverSun, Oct 9, 2022, 12:00 AM

Transcript

my name is sorek that's what everyone knows me online as i am a grey hat hacker and interestingly now a local politician in california most well known for developing sedia the alternative to the app store for jailbroken phones so if you've ever used a jailbroken iphone you probably use my software however currently i am working however thank you however currently i am working on orcid which is a decentralized marketplace for programmable bandwidth i've been doing that since 2017. been kind of embedded now in the crypto community i tend to go to conferences hackathons etc and i give i give talks on the scenes of exploits um so i i a lot of times our hacker conferences are in places like vegas where you see magicians like penn and teller give presentations and one of their big shticks is explaining how the trick works and then sometimes doing more tricks then they don't tell you how that works there are a lot of aspects of security that you can learn from seeing these kinds of mistakes and walking through the code and which we will not be doing today and seeing which is where the time will come from in some sense uh um and and seeing how a trivial mistake or an incorrect thought process can lead to oh yes sir you can take your laptop back i'm sorry i can incorrect thought process can lead to a complete control of the system and so the end part of the reason why is that we're really building mathematical abstractions here and as soon as you make even a single mistake you've done the moral equivalent of assuming one plus one is equal to three once you make an assumption like that if you ever remember your you know high school algebra um you now you can prove anything you want and a lot of times i think developers underestimate or underplay maybe understate the uh importance of these some potentially minor looking mistakes oh yeah there's a config file that sometimes you can't load oh yeah you know sometimes somebody will try to add an image to their account and it will fail no that mistake can now be compounded and built up potentially using other exploits or potentially just with incredibly tricky weaponization for the exploit in order to take control of your entire system in this case and so what it's worth i wrote an article asaric.comrik.com optimism.html which this talk is probably not going to live up to anyway in some sense but what i've done is i've extracted one quick single narrative from it that i believe that was really what resonated with people on comments on twitter um and also in some of the news and articles so quickly what is optimism the dictionary defines optimism as hopeless uh hopefulness and confidence about the future of the successful outcome of something where the doctrine especially i set forth by leibniz that this world is the best of all possible worlds and i think that that is in some sense what we're seeing um with with the with the community as a whole um so i sometimes some sense say that the original sin um with which which came from this bug was an attempt to store the um attempt to make a change to evm semantics to store the balances of the of all of the accounts as an erc20 contract sitting on top of the layer 2.

i point this out partly because in december 6th of 2020 i went on to the optimism discord channel based on an invitation on their website saying that for anyone where this would cause an issue or they believe that they see some kind of problem that they should [Music] that they should interesting that they should come onto discord in order to talk about it uh if this type of functionality is critical for your application please let us know on discord where i went and i explained that the issue that this would cause and the reason why this was a problem and fast forward a year later and we see ovm 2.0 come out and opm 2.0 attempts to fix some of the aspects of this moving from what would be maybe evm compatibility to evm equivalents and here's where we get to fast forward through a lot of things read the article and it goes through the actual exploit beautiful slides showing showing that the original that the code that they had implemented actually already had a discrepancy and a mistake uh it already was uh incompliant with uh the other evm implementations uh and that that and and because of what i would argue is a underlying incorrect architecture of the go ethereum itself which i think is actually being caused in some sense by a mantra from the go community about how packaged local access works leads to a a mistake where when you self-destruct a contract on optimism all of the balance of the money that is stored in that contract gets sent to get gets um gets gets not only sent to the beneficiary but on optimism would also get left in the original contract and due to then the um semantics of self-destruct which do not actually destroy the contract until the end of the transaction um you were able to have a contract self-destruct to itself in a loop doubling its amount balance each time in order to cause what some people some people call an inflation attack now at this point there'd be a slide which is the rick and morty episode with the setting the value of a dollar from one to zero which in some sense i kind of feel is is the kind of thing that these attacks whether it be bridge attacks or serious and infinite inflation attacks end up causing when you think about the kind of damage that you can cause with these issues it is brutal you go in and you just start buying up tokens and allow automated um automated arbitrage systems in order to begin bringing in uh and moving in money and and messing with the economy on the um on the l2 leading to a ledger that is so horribly confused that you can no longer piece it apart this is more devastating than merely taking a bunch of money from a reserve as you see in many bridge attacks because you can always put money back into a reserve but once you no longer know who has transacted with whom with a legitimate quantity of money and then and they're people who have somewhat legitimate claims because they were trading three levels deep on money that had originally been stolen what do you do so this bug was awarded i did not go max damage i responsibly disclosed it to optimism who paid me out a 2 million 42 dollar bug bounty [Applause] the 42 dollars we momentarily thought maybe this would be the largest bug bounty payout to a single developer for single bug ever but um it's not uh first of all there was a two million dollar one we saw and that's why the forty two dollars boba had um which is a fork of optimism kicked in an additional hundred thousand which was their max um so but sadly two point well sadly perspective having the fun of saying that it was a record 2.1 million dollars is still not the record it's 2.2 million dollars if anyone from medes is in the audience you know you had a one million dollar max max payout and there's not that much need to go to get the uh the back to the record but so i think as a community we spend a lot of time we end up accidentally replicating the mistakes of web 2.

0 with move fast and break things and i want to and and this is something that i end up talking to people and they they still remember silicon valley and move fast and break things i want to remind that in 2014 mark zuckerberg actually retracted move fast and break things he said move fast with stable info because when you build something that you don't have to fix 10 times you can move forward on top of what you've built these are the real changes that we're making so people can rely on us as a critical infrastructure for building all of their apps across every mobile platform measure twice cut once and we're done [Applause]

Automatic transcript — names and jargon may be misspelled.