In exec_create, if unable to transfer value, evm should be returned, not child_evm #70
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-08
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_primary
AI based primary 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#L195-L198
Vulnerability details
Impact
By returning child_evm, Kakarot will continue with the contract cration even though transferring the attached value was unsuccessful
Proof of Concept
Looking at the exec_create function:
If there is an error in transferring the value, 0 gets pushed to the stack, but the Kakarot VM continues execution in the child_context.
The correct behaviour should be that if there is an error in transferring value to the target address, Kakarot should continue execution in the current call context(not child context).
This way, the contract making the create call will know that there was an error, and handle it appropriately.
Recommended Mitigation Steps
return evm, not child_evm in the highighted code.
Assessed type
Other
The text was updated successfully, but these errors were encountered: