Improving the web3 security infrastructure with AI - ETHTallinn 2024 Workshop

ETHTallinn 2024 · April 2024 · 23:58

Edilson Osorio Junior gives a short ETHTallinn 2024 talk on using AI to strengthen web3 security. He reviews common threats such as governance attacks, phishing, price oracle manipulation, weak key storage and reentrancy, then outlines where AI can help: threat and phishing detection, anomaly detection and scanning smart contracts for vulnerabilities before and after deployment. He also lists limits, including false positives, manipulated or biased training data and unclear accountability, and says AI should complement rather than replace manual audits. In the Q&A he says zero-day vulnerabilities remain hard to predict.

Speakers

Topics

From ETHTallinn 2024, hosted by ETHTallinn.

Transcript

I'm here to just give a small introduction to Edelson ozorio Jr he's been for many many years in the space uh specifically relating to security and blockchain in general for over 20 years he's been working in cyber security and has started working on bitcoin specifically in 2011 so we've got a OG amongst us today he has worked on many projects in the crypto space such as voting authentication the first NFD project and the first decks on the ethereum blockchain he started his own company called Original my blockchain which is developing a software that is similar to e Estonia but for companies and recently he has released his own book written by

AI about blockchain he's an excellent educator and today he's here to give you a workshop about improving web 3 security and enhancing it through AI means so if you could just give a small Applause to Edon that would be very very appreciated thank you very much uh okay guys uh who is using here AI for for having fun with your smart contracts today someone one two okay that's that's perfect my talk today is about some uh enhance in security with AI is not a workshop because we have just a small time for doing the presentation today

but giving you ideas about what you can do with AI to improve your smart contract because well we know a lot of hacks are happening in our space all the time all the time many many millions of dollars being stolen hacked Frozen and uh we have a here some of the security challenges on web 3 we we have problems on governance attack uh daos the Dow we have a lot of problems of people having control of many votes and then manipulating what they can do on D and most of times they are getting a lot

of money from the treasury it's a big problem fishing attacks we we see every day every day someone is receiving some email asking people to go to some place and uh connect the wallet and then they get everything stolen it happens all the time price Oracle manipulation is a huge problem as well people are manipulating because oracles they are some of the oracles they are pretty weak then they can go to the Oracle manipulate the price of the Oracle like making this the token price smaller than it should be then they go to some Defi and retrieve do some transaction and retrieve a lot

of tokens because they manipulated the Oracle uh stalling private key and key and hashes it happens all the time as well we saw some case of the multi chain in China the CEO was like in prison we don't know he disappeared he disappeared so what they are saying the CEO was like in prison by the Chinese government then the much chain was like running without the CEO then something happened in the in the chain some uh vulnerable was exploited and some people started to drain all the funds of the the the muchi chain and then they Discovery the CEO had the he was the only guy with the

keys to do updates or managing the smart contracts then main died because of one guy he because of he disappearing and another thing is like people stealing keys they are storing keys in very weak places we got a a case in Brazil two two months ago probably the guy he was storing all the keys on a notepad on his desktop and he was live streaming and then he was showing some people to oh I have that that wallet let me open that wallet because of that c that token then he opened the

notepad during the live stream all the tokens were were drained for sure immediately and it happens all the time for with a lot of people reward manipulation is pretty similar to price or manipulation and governance attack people are manipulating the defi to get more rewards than he should and access control weak access control or not validating enough if the person can execute that thing or not hexs from the fault contract logic and hacks from the poor input checking both can be solved with AI as well and

reentrancy attack we had the first reent attack in the da 2016 a lot of years ago and it's happening yet today in many platforms we are evaluating people should learn how to not do that kind of thing but sometimes we know the the contract is pretty complex it's hard to like predict what will happen next then retra attacks is happening it's bad because some something is being executed without the order and sometimes they are just like uh with drawing tokens without the the

verification if he could withdraw the tokens being uh being executed then AI can help in that thing as well and here the top 10 losses in 20123 like two two Mill $200 million in mixing Network and even kyber swap was hacked last year how a I can help cyber security in general not just for web 3 but in general AI can help in threat detection it's pretty important because it has the ability to process a lot of m a lot a lot of data to try to identify and predict what can happen next incident

response if it detected something it can start the controls to try to try to mitigate the problem because it already happened but it it should start some controls we'll talk after the problems with AI controlling or managing uh things but we can it can even for example it can at least not even but can at least uh start or trigger an alert to the cyber security team take a decision and do something risk management it could assess everything on your platform and on your data and try to do some prediction about what could happen next

uh fishing detection is pretty important because it can detect it if it's a fishing when people are receiving the email when they are con trying to connect on your platform it could try to understand what is happening because the fishing emails they are pretty similar most of times and AI could detect everything or almost everything and then uh like deny the access or not enable the person to do the action he's trying to do one platform who is trying to use Ai and other tools is rabby wallet who is using rabby wallet instead of metam mask here one two you should use rabby wallet because it's better for TR it's

trying to predict what is happening when you are transferring tokens and metamask doesn't show the thing RAB is better in in that field and anomally Det ction something that that was not supposed to happen is happening and it could enable our system to to verify and mitigate fraudulent activities as well then we can leverage thei techniques techniques for web 3 we can use neural networks we can use machine learning and you can use even NL NLP all together or separately one by one neuron networks

they are good be I will show the next to one here is like who doesn't know about a neural network it seems like this we have the input layer it connects to all the nodes all the it's it's like the the it's like a neuron Network as well then we have you have hidden layers doing all the verification and everything even on different networks then you have the output layer who is delivering the output information denying or allowing something to happen it's pretty important to build something to connect and have interoperability with your other networks because sometimes okay you can start doing

something on your own platform but connecting to many platforms and many sares of data is better let's go back a little machine learning machine learning connected to neural networks is pretty important because that hidden layer I was showing it could be like empowered by Machine learning the decision taking or maybe signalizing something is getting wrong with AI could be better instead of just if something is happening consisting the thing okay my time is running yeah okay

then using machine learning is better and NLP we can say just like cat GPT or some or some G GPT for auditing your smart controls and okay here we have examples of neuron networks for fraud detection smart contracts Integrity risk assessment and even enhanced encryption techniques application I I I brought two applications very easy anomal detection and well well AI can detect like some kind of transactions that should not be happening on your platform and you can prevent like a potential large large scale fraud and

the second one auditing your smart contracts with AI you can use GPT or NLP and machine learning to scan your smart contract send identify many many kinds of vulnerabilities before deployment and even after the deployment better before one example this platform this is a screenshot of chain GPT they buil chain GPT already it's a you can you don't need to use that kind of thing you can use Chad GPT for doing the auditing on your code but some people built a platform for scanning and analyzing your smart contracts on chain after

deployment then it can tell you like oh lack of access control for meting it's huge because people can go there and meet like an unlimited number of tokens on your platform and is and the two detected that that kind of thing it's pretty easy to to build something just to detect or analyze your smart contracts uh some comparisons here having AI you can have a lot lot of vulnerability patterns covered or you can have a human very limited by the company competence you need to rely on the company competence the time really less using Ai and it can save you many

hours of like updating the system after uh deploying because if it was detected after you know the pain of updating smart contracts the cost is minimal false positive it's very important to talk about false positives I'll talk later and human consultation maybe you can have a human Specialized or not and the business Lo logic check then in this part you need a human AI is not aable totally yet to analyze your business uh model and everything you have on your company something is private and AI you have access just to the thing they were

trained cons of using AI false positives happens a lot happens a lot even using chat GPT sometimes the platform goes crazy you can't rely in any information they are producing and they are lack of the ability to fully fully understand the context and intent behind the smart contract code because some sometimes you are doing something very complex you should not but some people are building complex things on Smart contracts it should be simple and easy and fast to see what's happening over there very clear but people are sometimes it's

needed to build something more complex and theyi is not prepared to understand everything because as I said it understands just what it was trained uh a divers attacks people can manipulate the input to this Mar to the AI they can manipulate the AI then you could have problems if you rely just on AI to tell you if something is going wrong sometimes just uh triggering alerts or notifying you is better than making AI doing actions with your smart contracts and rely on training data another problem because sometimes

training data is biased it's incomplete or outdated and inaccurate as well so AI power tools should complement smart contract auditing not replacing manual audits eal concerns privacy implications because you need to train the AI with real data about what's happening then you should be aware about what kind of data you are feeding the eii potential for data manipulation because you can put a lot of bias and if someone is not working very well on your company and starts to put bad

information in the AI it to be very badly trained and then when you execute the thing it to do the wrong thing and we got the North Koreans from Lazarus they were putting a lot of people on the def5 space and tech companies in the def5 space to manipulate a lot of code and information where companies are using AI to try to understand what's happening and accountability who is the responsible for alerting or not alerting something the AI the company you and when I was looking for ethical issues with a of AI I it was a Google uh

research I did then they gave me this table with a lot of things of ethal issues of AI is uh from Google I just printed the thing and added here because a lot of thing to see future Trends predictive AI for blockchain forensics I I see a lot of space for this kind of thing yet uh you can anticipate or mitigate future security threats for identity verification you can use AI for ident identity verification processes better if you have a neural network connected to many dots and if the person is authenticated on one place you can

have a score for authenticating person on other places connecting all the thoughts uh AI driven encryption models it's very interesting just a few people is working on that kind of thing AI can decide to improve the encryption of some system depending on what it it detected so you can have ai taking some decision don't rely a lot of decision on AI but you can have ai driving those kind of decisions and integrating the future you can integrate I don't know quantum computers in the future iots and What's happen in the

future questions that was my presentation thank you very much then we have a space five minutes probably for our present questions any questions don't be shy yeah do does he need to use the microphone to be recorded yeah uh or do you think you can we can teach AI to like recognize the like um so security failure because we need to have like some data or some use like some case where something happened where do you find those data or example to train the

ai ai today it can detect on a very specific like chain of of events you need to get all the events of hacking of bad transactions transactions doing like sandwich attacks transactions draining funds from a smart contract transactions doing something wrong you can you need to have a lot of data in that field to train your your AI for that thing specifically for training for smart contracts you need to train another model uh feeding the machine learning with threats and vulnerabilities and and

cases of reent reentrancy attacks so each model should be specialized in one kind of or one vertical of the security are trying to apply it's possible whe okay it's for transactions on my defi you need to get all the transactions in the space or trying to find the hex and find the transaction where the hex happened to feed to train your AI with that information then something when some transaction is happening even on the main pool because then you run your Noe you uh you have the main pool where the transactions are before being

executed by a minor over validator depending on the network then it can predict oh it will happen on my my platform or another platform because it saw something happening before the machine learning can have that memory better okay did you answer okay good any other questions yeah I have a question about the problem that arises when you're dealing with new innovation or with innovation in general in the space and Ai and generally speaking also human

competence sort of relies on past examples and mistakes to make sure that um in the future incidents of the likes do not repeat and I was wondering what would you say about the unknown unknowns let's say in in the in the design of infrastructure and making sure that you take into account that there might be issues that you simply cannot predict both in general generally speaking cyber security as well as the design of the of the platform itself that that's a pretty good one in cyber security we we name it it's like a zero day it's a zero day happening on on uh zero day is a vulnerability that was

not exposed before so any no one was aware about what was happening it's pretty hard to detect zero days that's why they exist and you can train to predict something similar so maybe some of the the behavior they are executing will lead to some to exploit some vulnerability they can help can help can really help because it can predict faster than a human instead of doing ifs and else in your platform AI could try to predict that thing but zero days is pretty hard for the entire market and

even exist a market for zero days the they have on the the Deep Web in the darket they have a lot of uh dark markets for selling that those kind of zero days and it's pretty hard it's pretty hard so using AI to predict something because the behavior was similar okay and because it's faster and it's very reliable but all the AI they just predict because they were trained with data existing data so it's pretty hard it's a like a gray area of the AI it was not totally solved maybe when we achieve AGI the general uh intelligence maybe

but we are not even closer to that yet and and and U Google said next year we have AGI I don't know they're investing like a hundred billion dollars to try to reach a AGI maybe with AGI maybe but we can say okay any other question okay guys so before ending the thing I just released a book I invite everyone to to have a copy or find a copy on Amazon if you want it's the uh Chronicles of code Guardians of the code Guardians the origin of Tian it's a a Bitcoin journey of a young guy he was a Trader and learned a lot on in our space

it's a fiction it's not a very technical thing but it teaches a lot and has a lot of Easter eggs I I I think you like it and that's it thank you very much I think it's all thank you

Related talks