-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actors need to maintain two Kakarot accounts for L1 to L2 messaging #25
Comments
Severity: Low Comment: There is no security risk of any kind. But this will be fixed. |
dmvt marked the issue as unsatisfactory: |
dmvt marked issue #111 as primary and marked this issue as a duplicate of 111 |
dmvt marked the issue as not a duplicate |
dmvt marked the issue as unsatisfactory: |
Hi @dmvt, Can you please clarify why this was invalidated ? I see that this was deemed as Overinflated Severity at some point, so I'll answer with regards to that. The main reason why I believe this is a High is that there is a loss of funds involved. Starknet L1 to L2 messaging involves sending ETH to incentivize sequencers to relay the message and the ETH sent is consumed in full. In this case, actors will effectively pay ETH to relay a message, which, while succeeding on the Starknet level, is guaranteed to fail on the Kakarot EVM execution level unless they know beforehand that they need to maintain Starknet's ETH balances on their aliased addresses. Please review this again, thank you. |
Burning gas / bribes unnecessarily is not a high risk loss of funds. The only way significant funds would be lost is if the user decided to fund the alias, which in my opinion falls under the "conditional on user mistake" ruling. Regarding insufficient quality, if this were a high risk, I would expect a proof of concept that walks through the exploit and a more robust fix recommendation, not a feature request. Ruling stands. |
Hi @dmvt,
You are right, I should have probably added a code proof of concept, I incorrectly assumed that it wasn't required in this case. As for the recommendations steps, I suggested the removal of EOA aliasing first but also outlined that is only a partial solution to this issue without bridging. Thanks for taking a look at it again 👍 |
Lines of code
https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/solidity_contracts/src/L1L2Messaging/L1KakarotMessaging.sol#L32-L45
https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/kakarot/kakarot.cairo#L369-L385
https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/kakarot/library.cairo#L421-L438
Vulnerability details
Proof of Concept
L1KakarotMessaging
Kakarot
Library
Address aliasing is a common practice in L1 to L2 communication and is used to prevent L1 contracts from impersonating L2 contracts that have the same address.
In this case however, both EOAs and Smart Contracts addresses are aliased, and since there is no bridging involved, this leads to the messages failing unless the Kakarot account corresponding to the aliased address holds enough Starknet's ETH to pay for the Kakarot
eth_call
gas fees and specified value.This means that besides their normal Kakarot accounts, actors need to maintain enough funds on their aliased Kakarot accounts too, which they can only directly accessible through L1 to L2 messaging (.e.g you can transfer funds to the account but to get funds out from the account, you need an L1 to L2 message).
Recommended Mitigation Steps
Removing aliasing for EOAs would only fix the issue for EOAs that already bridged to Starknet and hold Starknet's ETH token. This means that a bridging logic is needed to handle both the EOAs that didn't bridge yet and the contracts cases.
Assessed type
Other
The text was updated successfully, but these errors were encountered: