DSS 2026 — A Safe EIP-7702 Reference Implementation Rudra Pratap Singh Source video: https://www.youtube.com/watch?v=gbVFuSp0RK8 Automatic captions — not human-reviewed. Complete spoken-audio coverage is unverified. Source language tag: en (English). Source export SHA256: 27a4eef37b90ab87dc56041d9939ab4b03f95c5ba92a44bc228ba0f4af513f6c [0:02] Hi everyone, good morning. [0:03] So first of all, [0:06] this talk was originally going to be [0:08] presented by Arda from Certik, but [0:10] unfortunately he's not able to make it, [0:12] so I'm replacing him. So myself Rudra [0:15] Pratap Singh and I lead triage at [0:17] Certik. [0:18] So this talk is going to be some of the [0:21] design observation that we made on chain [0:24] and some of the [0:26] things that we noticed about EIP 7702. [0:31] So next slide please. [0:33] So let's first understand how [0:36] EIP 7702 works. So a user signs a tuple [0:39] in a type four transaction, namely chain [0:42] ID, delegate and a nonce. And anybody [0:44] can carry forward. So basically anybody [0:47] can send it on chain or the user [0:48] himself. And once it's confirmed on [0:51] chain, the account points to a delegate [0:54] contract that the user provided. [0:56] And the contract that he [0:59] delegated to would run under the context [1:01] of the EOA. [1:02] Next slide please. [1:04] So at launch Wintermute noticed that 97% [1:09] of the delegated account pointed towards [1:11] the same sweeper contracts. [1:13] And we looked into the current [1:17] statistics where we looked into top 15 [1:20] delegate addresses and we found out that [1:22] it constituted for 8.51 million accounts [1:26] and that are [1:29] marked as [1:30] fishing. [1:32] So that does not mean that all of these [1:34] accounts are by themselves [1:37] malicious, but it is more like some of [1:39] these accounts are owned by the attacker [1:41] themselves as throwaway accounts. Next [1:43] slide please. [1:44] So how does these accounts end up there? [1:47] So there are two major reason. First the [1:50] attacker compromised the private key of [1:52] the victim. Secondly [1:55] the victim fall part of our fishing [1:57] campaign. [1:58] At the same time a simple 7702 contract, [2:01] sorry, [2:02] delegate contract, [2:03] has three major observation. First, it [2:06] does not have any any allow list. [2:09] Second, a valid signature can do [2:11] anything in the account. [2:13] And the last that the signature travels [2:15] through across the multiple delegations. [2:18] Next slide, please. [2:21] Yeah. So once we delegate, there are [2:23] eight powers that a delegate can hold. [2:26] First, the entry point, who can make the [2:28] account act. Secondly, what happens to [2:30] the incoming value. Third, what hap what [2:34] con outgoing calls does the delegate [2:36] makes and what call data it carries. [2:39] Last fourth, [2:41] what a signature can authorize and does [2:44] it have a replay protection or not. [2:46] And gas storage owners update and some [2:49] side effects. [2:50] Next slide, please. [2:52] So let's now look into a simple sweeper [2:54] contract. So I hope you can see this. So [2:57] it is very straightforward contract [3:00] where we have a destination address and [3:02] initialize function and a receive. [3:04] So if you look into the initialize [3:06] function, there is no protection on [3:08] there. So once like anybody can [3:11] initialize it. And if you if you can [3:14] read out the receive function, it [3:15] basically transfer whatever ETH that is [3:18] being sent in the same transaction to [3:20] the destination address. [3:22] Next slide, please. [3:25] A sweeper waits for water ETH. So we ran [3:28] a [3:29] test suite against these sweeper [3:30] contracts and we found out across four [3:32] properties that we tested, two of them [3:35] passed while two failed. Namely, the the [3:38] one that passed was a third party cannot [3:41] move the existing fund that the account [3:43] hold. [3:44] And the front running does not moves [3:46] fund. [3:47] But the two properties that broke were [3:50] that any incoming ETH that were [3:51] forwarded after the delegation [3:53] automatically moves forward to the [3:55] attacker. [3:56] And if you try to rescue and send [3:58] additional funds, it goes to the [4:00] attacker rather than staying in the [4:02] account itself. [4:03] Next slide, please. [4:05] Five ways a transaction get replay. So [4:08] the top three one are pretty widely [4:10] known. [4:11] But the two that are delegates and time [4:14] are not widely known and adopted. [4:17] So we are going to understand it [4:19] better, but for the context [4:22] a signature can does not automatically [4:25] get cancelled out if we [4:27] we delegate to a new address, meaning [4:29] that if we sign some request on a [4:32] previous delegation, it carries forward. [4:34] And the next one is time. [4:36] The [4:37] thing about time is that if let's [4:39] suppose that we have an allow list and [4:42] if we sign a request that is not valid [4:44] right now, but does not mean that it [4:47] would not be valid in the future [4:49] delegation. It might be a case where in [4:51] the future the signature becomes valid. [4:54] Next slide, please. [4:57] The next thing is revoking does not [4:59] means that it clears the code. Suppose [5:01] that you delegate to a buggy delegate [5:04] which writes owner variable in the [5:07] storage. [5:08] When [5:09] a normal user tries to revoke the [5:12] delegation, he assumes that the [5:15] the storage is automatically cleared, [5:17] but that's not the case. [5:19] We need to whenever we are [5:20] re-delegating, we need to make sure that [5:22] we clear the storage ourselves. [5:24] Next slide, please. [5:26] Two doors, one gate. So basically we are [5:28] moving forward to a design [5:30] suggestion that we are making. [5:32] So there are two ways a transaction [5:34] reaches on chain. One, a user signs the [5:36] transaction himself or he can give the [5:39] signature like a signed request to [5:41] another user who can submit on chain to [5:44] save gas. [5:46] But all of these like in in either of [5:48] these cases, it goes through the gate. [5:51] We are going to zoom in in the [5:52] the gate itself in the next slides, but [5:55] you need to understand in any in any of [5:58] these cases we are making sure we are [6:01] making a check against the policy in the [6:03] gate itself. Next slide please. [6:06] Now let's understand the gate. [6:08] So there are two levels. First is [6:12] the contact that we are [6:13] interacting with and the function that [6:15] we we are calling is it in a allow list [6:18] or not and who is the recipient and the [6:21] sender and whether they are approved in [6:23] the allow list or not. If in any cases [6:26] something breaks it the transaction does [6:28] not go through [6:29] and if everything seems to be good it [6:32] leaves it. But they here are three [6:35] major observation. First only the owner [6:37] can make changes to the policy. Second [6:40] when we change like make changes to the [6:43] policy it takes up to 48 hours. [6:46] Last removing anything affect at once. [6:48] So for example if you're trying to [6:50] remove some recipient from the list it [6:52] takes the effect takes immediately. Next [6:56] slide please. [6:58] Signature can't travel. So we talked [7:00] about in the previous slide about two [7:01] major problems that are generally [7:03] overlooked. So how do we come up [7:06] across those? So first when we say when [7:09] when I mention that when we sign a [7:11] request it travels through the [7:13] delegation. So we want to make sure that [7:15] when whenever we are signing a request [7:17] we embed [7:19] a delegation information within the [7:20] request itself so that the delegation [7:22] know who it was meant to be. [7:25] Next across time [7:26] we need to we need to maintain a policy [7:30] where we are checking against the [7:32] request whether this policy that the [7:35] user signed was meant to meant for it or [7:37] not. [7:38] And after [7:39] revocation we are wiping all the [7:41] policies that [7:43] that was [7:45] in there at that time. [7:46] Next slide please. [7:49] There are some caveats to the design. [7:52] I'm going to discuss two of them. [7:54] First as I mentioned that whenever we we [7:56] are making a new changes we have to wait [7:59] for 48 hours at least. [8:01] Secondly for any new configuration that [8:03] we are making we have to go and add it [8:05] ourselves and there are few others as [8:08] mentioned. Next slide, please. [8:11] So we ran some of the tests against 35 [8:16] of the tests and across that we also [8:19] implemented 21 deliberate bugs that we [8:23] wanted to catch and our test suite [8:26] actually got 21 out of 21. [8:28] The [8:29] then we ran we we forked the network and [8:32] ran it against the those buggy [8:34] implementation that we saw and it got [8:37] four out of five properties that were [8:39] failing meaning like the ETH that was [8:42] supposed to be transferred were [8:43] automatically being transferred to the [8:45] attacker [8:46] account. So the properties were failing. [8:49] Next slide, please. [8:51] So we have open sourced all of the [8:55] things that we discussed the design [8:56] implementation the attack suite and the [8:59] test cases in our [9:00] in the repo that is under the certik dev [9:03] repo. [9:04] So that's it for me. Thank you so much.