Selfdestruct opcode transfers ETH to the wrong address #83
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-b
primary issue
Highest quality submission among a set of duplicates
Q-07
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_13_group
AI based duplicate group recommendation
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/kakarot/instructions/system_operations.cairo#L845-L850
https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/backend/starknet.cairo#L192-L201
Vulnerability details
Description
The selfdestruct opcode sends the funds to the zero address: https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/kakarot/instructions/system_operations.cairo#L845-L850
However the correct address seems to be
Constants.BURN_ADDRESS
which is used in_commit_account
:https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/backend/starknet.cairo#L192-L201
Sending the funds to the zero address can be risky as if account contracts are not enforced by the Starknet OS then any burned funds will be claimable by any user.
Recommended Mitigation Steps
Send the funds to the burn address instead
Assessed type
ETH-Transfer
The text was updated successfully, but these errors were encountered: