1 00:00:08,520 --> 00:00:12,820 Yeah, I hope my talk can give you guys a taste of Web3 security. 2 00:00:13,300 --> 00:00:14,920 So my name is Pei-Yu Wang. 3 00:00:14,920 --> 00:00:16,740 I'm a security engineer here. 4 00:00:16,820 --> 00:00:22,040 Uh, so what I do is, uh, application penetration testing, uh, mostly Web3 applications. 5 00:00:23,460 --> 00:00:27,760 And I also do, uh, smart contract audits and security research. 6 00:00:27,760 --> 00:00:36,980 Uh, my past talk at DEF CON are in the, uh, blockchain village, which I talk about, uh, exploiting crypto wallets and, uh, DeFi scam and rob pools. 7 00:00:36,980 --> 00:00:38,700 So I talk outside of, like, words. 8 00:00:38,700 --> 00:00:39,900 I'm, like, a DeFi apes. 9 00:00:39,900 --> 00:00:41,980 I'm, like, a mincoin, uh, traders. 10 00:00:43,160 --> 00:00:45,080 Blockchain and the apps. 11 00:00:45,180 --> 00:00:52,640 So since the first, uh, DeFi summer in 2020, uh, the, uh, the blockchain ecosystem has exceptional growth. 12 00:00:52,640 --> 00:00:54,280 There's a lot of things being built. 13 00:00:54,280 --> 00:01:01,660 And one way to catalyze them is, like, applications, developer tools, uh, infrastructure, and protocols, which is the blockchain itself. 14 00:01:01,660 --> 00:01:06,040 So we're at the AppSite village, and let's talk about applications. 15 00:01:06,160 --> 00:01:10,420 Uh, so the most common AppSite-heavy Web3 products are the following. 16 00:01:10,420 --> 00:01:16,080 The first one is centralized exchanges, such as, like, Coinbase, uh, Binance, which you guys are probably familiar with. 17 00:01:16,080 --> 00:01:17,760 Uh, and then data platform. 18 00:01:17,760 --> 00:01:23,120 So the raw data for, uh, blockchain transactions are extremely hard for people to read. 19 00:01:23,120 --> 00:01:29,500 So, uh, there's, like, application like Etherscan that help, uh, people to, like, read data, read transaction data. 20 00:01:29,500 --> 00:01:30,900 And there's a wallet. 21 00:01:30,980 --> 00:01:37,440 Uh, so wallet is a type of application that holds the private key and performs the signing request, uh, when requested. 22 00:01:37,440 --> 00:01:41,200 The most popular wallet probably is the, uh, wallet MetaMask. 23 00:01:41,200 --> 00:01:42,780 And then there's, uh, Dapps. 24 00:01:42,780 --> 00:01:52,640 So I def- uh, the definition I give Dapp is a wide range of applications that include the functionality that implements through the, uh, on-chain smart contract. 25 00:01:52,640 --> 00:01:59,220 So all four type of applications play a very important role in the, uh, application space in blockchain. 26 00:01:59,220 --> 00:02:03,700 And they all have their own, uh, unique type of services. 27 00:02:03,700 --> 00:02:06,360 Today I will talk about the one for the app. 28 00:02:07,040 --> 00:02:12,160 So throughout this presentation, I will be talking about a lot of blockchain technologies. 29 00:02:12,160 --> 00:02:15,880 So I want to start by explaining them in web 2 terms. 30 00:02:15,880 --> 00:02:17,220 So first, smart contract. 31 00:02:17,220 --> 00:02:23,480 Smart contract, you can think of, it's a backend API server and a bunch of, uh, private functions. 32 00:02:23,480 --> 00:02:25,840 So inside smart contract, there's a lot of functions. 33 00:02:25,840 --> 00:02:30,740 Some functions can only be called by, say, admin or owner address. 34 00:02:30,740 --> 00:02:35,940 Those functions typically, uh, actions, operations, contract. 35 00:02:35,980 --> 00:02:37,660 Um, and then there are transactions. 36 00:02:37,660 --> 00:02:44,040 Transactions, you can think of, it's like, uh, a bundle of POST requests that's sent to the smart contract. 37 00:02:44,040 --> 00:02:47,720 Transaction hash is a unique identifier for each transaction. 38 00:02:47,720 --> 00:02:54,180 Where you can, uh, uh, pull the, pull the transaction information out by using the transaction hash. 39 00:02:54,180 --> 00:03:00,420 Uh, so guess, so imagine, uh, a web server that charges a certain amount of fee for each POST request. 40 00:03:00,420 --> 00:03:07,620 That's like, uh, so each, each, uh, blockchain transaction will charge, uh, some sort of, like, uh, crypto assets. 41 00:03:07,640 --> 00:03:15,780 And when there's a lot of people sending these, like, POST requests to a smart contract, the more you pay, the faster your transaction, uh, will be executed. 42 00:03:16,360 --> 00:03:19,560 Uh, so blockchain is formed by, like, a block by block. 43 00:03:19,560 --> 00:03:23,940 And each block, you can think of, it contains, uh, multiple, like, POST requests. 44 00:03:23,940 --> 00:03:28,420 Uh, and then each block has, like, set amount of time in between. 45 00:03:28,420 --> 00:03:32,980 You can think of, like, batch of POST requests get executed, like, block by block. 46 00:03:32,980 --> 00:03:34,840 And there's a certain time in between. 47 00:03:34,840 --> 00:03:40,860 So blockchain RPC is the communication channel that exposed by, like, blockchain nodes. 48 00:03:40,860 --> 00:03:45,860 So the outside can, an entity can talk to the, uh, blockchain. 49 00:03:45,860 --> 00:03:54,940 And NFT is type of, like, uh, uh, digital assets that inform an image with ownership information for blockchain and image data and metadata for blockchain. 50 00:03:55,780 --> 00:03:59,400 So this is, like, a general workflow for, uh, the app. 51 00:03:59,400 --> 00:04:06,260 The app you see there is Uniswap, probably most popular and most well, uh, most used app. 52 00:04:06,280 --> 00:04:10,940 Uh, so, uh, you go to a website, there's, like, a connect button, and you click that. 53 00:04:11,380 --> 00:04:15,700 That will trigger a connection request, uh, pop up from the wallet. 54 00:04:15,740 --> 00:04:21,860 And if you trust the application, you can click next, so that your wallet is going to connect with the app. 55 00:04:22,440 --> 00:04:25,960 And after connection is established, you can start using the app. 56 00:04:25,960 --> 00:04:33,440 In this example, I exchanged 0.01 Ether to 24 USDT, and I can, I can click the swap. 57 00:04:33,440 --> 00:04:36,980 And that transaction gets sent to the extension wallet. 58 00:04:36,980 --> 00:04:43,260 And once you click the confirm, which means you sign the transaction, and that transaction will be sent to the blockchain and execute. 59 00:04:43,260 --> 00:04:46,960 And then that transaction will get executed, and the token will be swapped. 60 00:04:47,940 --> 00:04:50,120 Uh, next I'll talk about the app architecture. 61 00:04:50,340 --> 00:04:57,820 So this is, uh, standard web, web 2 applications, where you have, like, client-side, uh, app. 62 00:04:57,820 --> 00:05:01,640 And then you have, like, server-side components, like web server API database. 63 00:05:01,640 --> 00:05:03,460 I'm sure everyone is familiar with that. 64 00:05:04,240 --> 00:05:07,760 And then, yes, I put into three categories. 65 00:05:07,760 --> 00:05:11,100 The first one is API-less, yeah. 66 00:05:11,100 --> 00:05:15,720 Uh, what it means is the app on the server-side, there's no API. 67 00:05:15,720 --> 00:05:18,000 It's just static HTML, JS file. 68 00:05:18,660 --> 00:05:22,220 And the main logic is inside the, uh, smart contract. 69 00:05:22,920 --> 00:05:31,100 So, uh, for example, the, uh, example I gave, uh, Uniswap, the early day version of Uniswap is, uh, like, API-less, the app. 70 00:05:31,100 --> 00:05:35,220 Uh, where the, like, token exchange information is covered by a smart contract. 71 00:05:35,220 --> 00:05:38,700 And the front-end just, uh, help with, like, user interactions. 72 00:05:38,980 --> 00:05:44,040 So this type of the app, the attack surface of the application site is quite limited. 73 00:05:44,180 --> 00:05:48,020 Uh, so, and this type of the app typically built with the React framework. 74 00:05:48,020 --> 00:05:51,060 And React has, sort of, like, SSS building protection there. 75 00:05:51,060 --> 00:05:52,580 So it's hard to find SSS there. 76 00:05:52,600 --> 00:05:58,020 And then, unless you have, like, you can complete the whole site by, say, using, like, DNS hijacking. 77 00:05:58,020 --> 00:06:01,040 The application site, uh, the attack surface is very limited. 78 00:06:01,040 --> 00:06:06,540 And typically when this kind of application is exported, it's often the vulnerability from the smart contract. 79 00:06:07,400 --> 00:06:10,620 Uh, now the second one is API-enabled app. 80 00:06:10,620 --> 00:06:15,360 Uh, so compared to the last one, this one has, on the servers, it has, uh, service APIs. 81 00:06:15,440 --> 00:06:18,920 And one example is the, uh, NFT creation app. 82 00:06:18,920 --> 00:06:26,140 So it, uh, the server has API allow users to download images or, like, NFT metadata JSON to the back-end. 83 00:06:26,140 --> 00:06:28,660 Uh, and then the back-end is going to return, like, a URL. 84 00:06:28,660 --> 00:06:31,460 So you can use the URL to talk to the smart contract. 85 00:06:32,360 --> 00:06:40,000 Uh, the attack surface for this type of app does increase, but the vulnerability on the application site is mostly, like, Web2 related. 86 00:06:40,740 --> 00:06:43,100 And now move to the full-scale Dapps. 87 00:06:43,100 --> 00:06:50,320 So full-scale Dapps, uh, the back-end is going to talk to the smart contract, like, read data or send transactions. 88 00:06:50,320 --> 00:06:58,100 Uh, so oftentimes in the full-scale Dapp, the smart, the, uh, smart contract will have privilege functions. 89 00:06:58,100 --> 00:07:04,200 And the account that can call those privilege functions is private key or stored in the back-end server. 90 00:07:04,200 --> 00:07:18,640 So if you have a way to, say, for example, compromise the server or have triggers on, like, an arrow, you're likely, you're likely able to, say, uh, obtain that key from the server and completely transfer out all the money from the smart contract for, 91 00:07:18,640 --> 00:07:20,780 uh, all the damages. 92 00:07:20,940 --> 00:07:27,040 So the majority of Dapps in 2024 are, like, a full-scale Dapp, uh, compared to, like, 2020. 93 00:07:27,040 --> 00:07:31,160 By summer, there's about, like, 80 less Dapps. 94 00:07:31,420 --> 00:07:35,300 One example of, like, a full-scale Dapp is cross-chain bridge. 95 00:07:35,300 --> 00:07:42,940 So cross-chain bridge allows, uh, users to transfer to cross-chain bridge tokens from one company to another. 96 00:07:42,940 --> 00:07:47,220 For example, to, uh, use tokens from, like, Polygon. 97 00:07:47,220 --> 00:07:55,420 Uh , because blockchain, the smart contract blockchain cannot talk to, uh, each other, uh, with cross-blockchain. 98 00:07:55,420 --> 00:08:00,740 So this type of application must require, uh, a blockchain component. 99 00:08:00,740 --> 00:08:09,800 So how bridge should work is, uh, on the source chain, users deposit tokens to the source chain smart contract, and the back-end monitors that deposit event and processes it. 100 00:08:09,800 --> 00:08:13,840 And if everything looks good, you will call the privileged functions in the destination 101 00:08:18,380 --> 00:08:18,980 . 102 00:08:18,980 --> 00:08:20,680 Let's talk about Dapps thread modeling. 103 00:08:21,420 --> 00:08:27,740 So from a thread modeling perspective, most smart contract assets in Web3 are, like, public key or private key. 104 00:08:27,740 --> 00:08:30,840 First one is, uh, private key. 105 00:08:30,840 --> 00:08:37,020 If you can get those, you can have control over the, uh, assets in the address. 106 00:08:37,020 --> 00:08:40,840 Or you can, uh, uh, you know, like, create a function for the smart contract. 107 00:08:40,840 --> 00:08:42,900 Second one is, uh, signatures. 108 00:08:42,900 --> 00:09:08,510 So for certain types of tokens, if you can, uh, certain type of tokens allows, uh, if you can have the, uh, special message signed by the, uh, and there's, there's a lot of, uh, signing those type of message, and then, uh, The last one is API keys. 109 00:09:08,510 --> 00:09:14,970 So this API keys is for those, like, such as, like, centralized exchanges. 110 00:09:14,970 --> 00:09:18,030 Once you get those API keys, you can... 111 00:09:23,020 --> 00:09:32,120 I talk about, like, I, uh, I will start to talk about, uh, client-side attack by mentioning a term called already, uh, connected. 112 00:09:33,490 --> 00:09:41,890 So in the, uh, dApp workflow session, I talk about, like, uh, if a user wants to use a dApp, the dApp must connect to their wallet. 113 00:09:41,890 --> 00:09:49,630 And there's a best practice in Web3 that users should only connect their wallet to the dApp they trust. 114 00:09:49,630 --> 00:09:57,750 And then once, and when users trust the dApp, they just sign whatever, like, things the dApp want the user to sign. 115 00:09:57,750 --> 00:10:08,890 So any vulnerability that exists in client-side vulnerability inside the dApp that has a lot of user connected wallet, and it's very popular, the severity is going to increase, like, dramatically. 116 00:10:09,810 --> 00:10:15,570 So from a client-side attack perspective, there are, like, three things attackers will do. 117 00:10:15,570 --> 00:10:19,770 One is malicious transactions. 118 00:10:19,770 --> 00:10:27,630 How that can happen is the attacker can, um, basically modify the JavaScript code of the, uh, website. 119 00:10:27,630 --> 00:10:31,510 For example, to, like, cross-site security, hijacking. 120 00:10:31,510 --> 00:10:38,230 Um, it's possible to have those malicious JavaScript and initialize, uh, the malicious transaction to take out. 121 00:10:39,000 --> 00:10:50,290 And if JavaScript is not possible, and if, like, hijacking is possible, another option is to deceive the user to do something else. 122 00:10:50,570 --> 00:10:54,590 The last one is, uh, the user to actually sign. 123 00:10:56,370 --> 00:11:05,590 And for, uh, already connected wallet website, um, everything that can initial, uh, will have critical vulnerability. 124 00:11:05,590 --> 00:11:11,050 So as it says, right, in Web 2, even if you have, like, account takeover, most of the time it's, like, high. 125 00:11:11,070 --> 00:11:12,890 It's maybe, like, a low critical. 126 00:11:12,890 --> 00:11:15,570 But in Web 3, it's definitely going to be, um... 127 00:11:17,030 --> 00:11:19,130 So let's talk about server-side. 128 00:11:19,130 --> 00:11:24,390 So from a server-side perspective, um, there's, like, sort of, like, four things the attacker will want to do. 129 00:11:24,390 --> 00:11:26,870 The first one is stealing the keys from the server. 130 00:11:27,010 --> 00:11:33,150 Um, basically, if you're stealing the key, you probably can't do it without the, uh, the message from the project. 131 00:11:33,150 --> 00:11:36,770 And this is sort of another way that they can potentially do that. 132 00:11:36,770 --> 00:11:41,930 And the second one is stealing crypto assets from other users' accounts or, like, admins' accounts. 133 00:11:41,930 --> 00:11:52,650 They will probably buy, like, uh, broken access control, um, or you can spend, uh, assets, uh, more than your actual balance. 134 00:11:52,650 --> 00:11:55,690 That can probably happen, like, business logic error or risk condition. 135 00:11:55,690 --> 00:12:00,350 And for NFTs, as I mentioned, those, like, images are stored, like, all the time. 136 00:12:00,350 --> 00:12:05,450 And if those images are broken down, there's a value going to drop, like, dramatically. 137 00:12:05,530 --> 00:12:08,870 And that's what can happen when, like, uh, NFTs die. 138 00:12:09,490 --> 00:12:15,050 So Web3, anything that can touch this money, it goes super low and has a critical severity. 139 00:12:15,050 --> 00:12:15,850 In the 140 00:12:25,570 --> 00:12:31,910 last session, I talked about how Web2 attack better and have higher severity in Web3. 141 00:12:31,910 --> 00:12:37,370 In the next sessions, I will talk about, um, kind of, like, unique, better attack services. 142 00:12:37,470 --> 00:12:37,890 So 143 00:12:41,280 --> 00:12:46,940 , I think due to the time constraint, I cannot go over, like, each sub-item one by one. 144 00:12:46,940 --> 00:12:47,080 In short 145 00:12:50,650 --> 00:12:59,890 , incorrectly processed transactions, and it's possible to initial attack against backend components. 146 00:13:01,010 --> 00:13:09,710 And if the application handles, uh, the logic to handle different assets costs is incorrect, uh, it can also... 147 00:13:11,660 --> 00:13:16,020 So the first case I want to talk about is, uh, wasted crypto. 148 00:13:16,020 --> 00:13:18,720 Yes, we are unregistered APIs. 149 00:13:18,800 --> 00:13:25,380 So, this application is, uh, that require users to register for participation. 150 00:13:25,600 --> 00:13:27,860 How the registration workflow is, 151 00:13:31,530 --> 00:13:37,430 user can provide their own check address, uh, and then, uh, backend is called... 152 00:13:37,430 --> 00:13:47,990 Yeah, so the finding here is that, well, that's amazing, uh, is, so the APIs accept any assumed address as long as the address data is in the correct format. 153 00:13:47,990 --> 00:13:56,070 So each time the API is called, the backend is going to send a transaction to the smart contract, and as I talk about, each transaction can cost gas. 154 00:13:56,070 --> 00:13:58,830 Gas is, like, uh, you can think of as money. 155 00:13:58,870 --> 00:14:13,350 So the way to exploit this is, like, I can generate a bunch of, like, random assumed address and keep calling the API to let the admin wallet keep sending transaction to smart contract, and eventually consume all the users in the admin's wallet. 156 00:14:13,350 --> 00:14:19,790 So this not only consume all the users, but allow, like, and prevent, like, other users to register. 157 00:14:20,570 --> 00:14:23,910 Uh, so this is, like, the, uh, transaction log when I do the testing. 158 00:14:23,910 --> 00:14:27,930 So this is in the test net, so there's no actual, like, uh, assets lost. 159 00:14:27,990 --> 00:14:35,210 Um, so I write a script to generate a bunch of address and put the request into, like, burp repeater, and then just send it. 160 00:14:35,210 --> 00:14:39,210 And then when I, uh, go to user scan, and I see the, those, like, records. 161 00:14:40,090 --> 00:14:44,630 Uh, the second one is poor transaction time head-only lead to denied service attack. 162 00:14:44,630 --> 00:14:57,050 So this can actually happens in any DApp that have API to trigger the backend to send a transaction and keep the connection open while waiting for the on-chain transaction, uh, execution results. 163 00:14:57,050 --> 00:15:01,630 So the, uh, the example code snippet is, I generate using, like, CGVTs. 164 00:15:01,630 --> 00:15:04,390 So it's basically, uh, API call deposit. 165 00:15:04,890 --> 00:15:12,550 Uh, and when user call this API, it's gonna trigger the, uh, backend to send a deposit transaction to the smart contract. 166 00:15:12,550 --> 00:15:18,710 And the code will wait for the transaction executed, and then send HTTP response to the users. 167 00:15:19,410 --> 00:15:30,670 So what's the problem here is that, for example, on a certain mainnet, the block time is 12 seconds, which means the HTTP connection will be, remain open for at least 12 seconds. 168 00:15:30,670 --> 00:15:35,410 If the chain is congested, it can, uh, the, the time can be much longer. 169 00:15:35,470 --> 00:15:49,530 So, uh, to exploit this, uh, APIs, uh, only, like, only one single machine is required to send out a bunch of, like, API requests, and to, uh, occupy all the connection slots, and the server is not going to handle any, like, more requests. 170 00:15:50,390 --> 00:15:54,910 Um, the next one is poor transaction time handling lead to risk conditions. 171 00:15:54,910 --> 00:16:01,670 So this is, uh, gaming, like a Gamefy dApp that allow user to purchase, like, in-game items using crypto assets. 172 00:16:01,750 --> 00:16:15,450 Um, so deposit workflow by, uh, user deposit crypto assets into the game smart contract, and then backend, uh, retrieve those deposit information from the smart contract to increase the user's, uh, in-game balance. 173 00:16:15,770 --> 00:16:30,510 And what's the interesting part is the withdraw crypto workflow, is, uh, the withdraw workflow work by user submit a withdraw API request to the backend, and the backend verify user's balance, and call the, uh, privilege function withdraw in a smart contract, 174 00:16:30,510 --> 00:16:39,050 and after the transaction finish, uh, the token will arrive in user's on-chain wallet, and the backend is gonna update the user balance to zero. 175 00:16:39,950 --> 00:16:54,810 So what's the problem here is that, um, the backend, uh, update the user balance only after the, after the transaction successfully executed, and it doesn't log the transaction balance, uh, when it sends the on-chain transactions. 176 00:16:54,910 --> 00:17:03,930 So in the, so for example in Serum, like, 12-second block time, user have 12-second window to spend their, like, in-game, like, currencies. 177 00:17:03,950 --> 00:17:15,130 Uh, so they can basically in those, uh, time period they can buy a hundred worth of, like, uh, uh, in-game items, and then wait for the transaction to finish, and those token will be arrived in their wallet. 178 00:17:15,130 --> 00:17:19,310 Uh, this way user can basically purchase all the in-game item for free. 179 00:17:19,310 --> 00:17:32,470 Um, and a race condition can also happens in, like, Web2, but, uh, the, uh, the time window for that in Web2 is much smaller, but in Web3 the time window in this case is at least 12 seconds, so it's, uh, much easier to pull off. 180 00:17:32,470 --> 00:17:39,910 Um, the next one is, uh, bridge contract, bridge backend, lack of smart contract address validations. 181 00:17:39,910 --> 00:17:43,910 So, uh, I, I talk about, like, how bridge work briefly, uh, previous slide. 182 00:17:43,910 --> 00:17:58,270 So for this particular bridge, the workflow is, like, user deposit tokens into smart contract on the source chain, and obtain a transaction hash, and then the user submit the transaction hash to the backend through APIs, and the backend fetch the, uh, 183 00:17:58,270 --> 00:18:12,330 information with the transaction hash, uh, to validate the deposit, and if anything goes correctly, the bridge backend really is gonna call the privilege function in the smart contract destination chain and release the fund to the user. 184 00:18:13,290 --> 00:18:28,730 Um , so for this kind of bridge, the backend actually need to validate, uh, tons of stuff, and in that particular application, it need to validate, for example, the transaction status is successful, and, uh, it need to take, uh, get the information of the deposit amount, 185 00:18:28,730 --> 00:18:46,450 the sender, receiver address, and if anything is not validated correctly, it can cause the bridge to become vulnerable, and in this case, the backend does not verify the smart contract that received the token is the one operate by the, uh, by the project. 186 00:18:47,390 --> 00:19:03,070 Um, so to exploit this vulnerability that Teflo will be, uh, I am going to deploy a malicious smart contract on the blockchain that basically share the same functionality as the legitimate smart contract, and I make a token deposit into that fake bridge contract, 187 00:19:03,070 --> 00:19:20,490 and obtain a transaction hash, and I submit a transaction hash to the bridge backend through APIs, and , uh, and wait for the bridge backend to process the hash, and because I'm missing the address validation , so if you think the address is correct, and then it's going to release the tokens, 188 00:19:20,490 --> 00:19:33,030 uh, to the, to the, uh, users on the destination chain, and when that happens, um, and , and after that, the user can withdraw his, uh, like, tokens sent to the fake contract, because that's, he had full control of that. 189 00:19:33,370 --> 00:19:38,950 And if this vulnerability get exploited, like, all the tokens in the destination chain smart contract can be stolen. 190 00:19:39,510 --> 00:19:41,190 Alright, so the last case. 191 00:19:41,190 --> 00:19:47,490 So this is like a lightweight crypto trading applications, where user can deposit assets and perform, like, token swap. 192 00:19:47,490 --> 00:19:50,830 Uh, the backend use, like, Fireblock as custodian services. 193 00:19:50,830 --> 00:20:02,270 Uh, how the deposit work is, user request, uh, uh , like, a deposit address through APIs, and then the backend gonna get one from Fireblock, and then the user gonna deposit crypto asset to the address. 194 00:20:02,550 --> 00:20:13,610 And then the backend periodically query the Fireblock.getTransaction API, and if it sees the deposit transactions, it gonna, uh, give the user the in-app balance. 195 00:20:13,990 --> 00:20:22,330 So we are, when we are doing the testing, so we deposit, like, 0.1 metatoken to deposit address, and the, and the balance increase by 1.1. 196 00:20:22,330 --> 00:20:27,310 And we are so confused, because this is not, like , double or ten times, it just, it's, like , increased by 1. 197 00:20:27,470 --> 00:20:33,650 So we go to the on-chain, the, uh, Polygon scan, and see there's only, like, 0.1 metatoken arrive in the address. 198 00:20:34,330 --> 00:20:40,110 Um, however, we found a record of, like, a scammed NFT airdropped into that address. 199 00:20:40,110 --> 00:20:49,090 So it's quite common for scammers to airdrop, like, NFTs, uh, with, like, phishing site link in the token information to a newly added address within the blockchain. 200 00:20:49,090 --> 00:20:56,850 Newly added address is, like, a, like, a crypto with value for the first time. 201 00:20:57,190 --> 00:21:02,970 So the backend treat that value list NFT as a valid, like, a magic deposit. 202 00:21:02,970 --> 00:21:15,710 Uh, so this is a whiteboard testing, and we found out the root cause is that the backend just, uh, uh, doesn't, doesn't, what, when it parsed the information returned by Fireblock, it failed to check the token type. 203 00:21:15,710 --> 00:21:26,690 So to exploit this issue, we, we deploy a URC -1155 NFT and make 99 NFT with no value to the address, and which caused our, uh, account to increase, like, 99 magic. 204 00:21:27,530 --> 00:21:46,110 Uh, so to summarize the state of, like, DApp security, so right now with the advance of, like, blockchain ecosystem, DApp becomes, like, more and more complex, and some of them start integrating heavy Web2 components, and often vulnerability are introduced in DApp because a lot of developers either lack of Web3 security knowledge or Web2 security knowledge. 205 00:21:46,610 --> 00:21:53,830 And, uh, Web, uh, Web2 vulnerability in Web3 application often has, like, increased severity because it can touch monies. 206 00:21:54,230 --> 00:22:04,770 Um, and unlike smart contracts where, where it's, like, publicly viewable, the exploitation of the backend might have less exposure because no one can see it, uh, but it can still happen. 207 00:22:04,770 --> 00:22:16,630 So to secure a DApp, especially a DApp with, like, heavy backend components, it is, like, as important to get, uh, penetration testing compared, uh, as, like, getting, uh, like, audits for your smart contract. 208 00:22:16,630 --> 00:22:19,310 Um, this is the last slide. 209 00:22:19,310 --> 00:22:33,270 So, if you want to get into DApp hacking, uh, I would suggest, like, you, you be, first be decent at Web2 application hacking because at the end of the day, there's tons of Web2 components and you need to be familiar with different type, the architecture of different type of DApps. 210 00:22:33,270 --> 00:22:39,970 That way you will know what the attack services are for this app, and the best way to do it is play around with DApp to experiment then. 211 00:22:40,010 --> 00:22:45,270 An investment of, like, $100 of crypto, uh, probably going to waste in gas is going to be enough. 212 00:22:45,270 --> 00:22:52,930 And to understand, like, basic, uh, concept of blockchain, include those, like, Web2 terminology, you don't really need to understand how blockchain work. 213 00:22:53,110 --> 00:23:00,170 And then you learn the smart con- solidity smart contract language so you can understand smart contract, and sometimes you can find some, like, hidden attack services. 214 00:23:00,170 --> 00:23:05,150 And it's not necessarily require you to know, like, how to do a secure audit of smart contract. 215 00:23:05,150 --> 00:23:06,490 That's a completely different topic. 216 00:23:06,510 --> 00:23:18,290 Uh, and go find a DApp and hack it legally, and start, like, and, so I believe, like, starting hacking in DApp is probably one of the best way for, like, Web2 website hackers that pivot into Web3 security. 217 00:23:18,590 --> 00:23:24,550 And, uh, well, if you want to ask me, like, why, like, Web3 security, I mean, like, uh, look at this bounty, like $10 million. 218 00:23:24,550 --> 00:23:28,250 Uh, well, I don't think this can ever happen in Web2. 219 00:23:28,250 --> 00:23:31,010 So, uh, so, yeah, uh, I guess people love money. 220 00:23:31,010 --> 00:23:33,690 Uh , alright, so that's my talk. 221 00:23:33,690 --> 00:23:36,990 I hope you guys enjoy and learn something about Web3 security. 222 00:23:36,990 --> 00:23:37,710 Thank you. 223 00:23:43,550 --> 00:23:44,950 Thank you.