First Flight #21: KittyFi

First Flight #21
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: high
Invalid

lacks of proper access control in burnKittyCoin()

Summary

The vulnerability allows any user to burn tokens from any other user's balance without authorization. This can lead to a significant loss of funds and disrupt the proper functioning of the token ecosystem.

Vulnerability Details

Function: burnKittyCoin

function burnKittyCoin(address _onBehalfOf, uint256 _ameownt) external {
kittyCoinMeownted[_onBehalfOf] -= _ameownt;
i_kittyCoin.burn(msg.sender, _ameownt);
}

Impact

Any user can burn tokens from any other user's balance without authorization.

PoC to demonstrate the exploit:

contract Exploit {
KittyPool kittyPool;
constructor(address _kittyPool) {
kittyPool = KittyPool(_kittyPool);
}
function executeExploit(address victim, uint256 amount) external {
kittyPool.burnKittyCoin(victim, amount);
}
}

Tools Used

manual review and foundry

Recommendations

function should be modified to ensure that users can only burn their own tokens.

function burnKittyCoin(uint256 _ameownt) external {
require(kittyCoinMeownted[msg.sender] >= _ameownt, "Insufficient balance to burn");
kittyCoinMeownted[msg.sender] -= _ameownt;
i_kittyCoin.burn(msg.sender, _ameownt);
}
Updates

Lead Judging Commences

shikhar229169 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.