-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KGA-29] [KGA-136] fix: cases with Cairo precompiles and delegatecalls (
#1567) Fixes the issue raised during the audit about eventual honeypots that could lure a user and manipulate starknet tokens without explicit approvals 1. Remove dependence on the `code_address` for whitelisting, which were reported dangerous. 2. Disable ability of having nesting a delegatecall to 0x75001 at protocol level. (no longer possible to do User A -call-> contract C -delegatecall->DualVmToken -delegatecall->0x75001 as a byproduct of 1. 3. Disable ability of calling 0x75002 with a DELEGATECALL at protocol level 4. Added noDelegateCall modifier to L2KakarotMessaging and DualVMToken for extra security 4. Added associated tests under `Security/` code-423n4/2024-09-kakarot-findings#38 Closes #1562 <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/1567) <!-- Reviewable:end --> --------- Co-authored-by: Oba <[email protected]> Co-authored-by: Clément Walter <[email protected]>
- Loading branch information
1 parent
cbe1c81
commit 8e37d05
Showing
19 changed files
with
783 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.