First Flight #21: KittyFi

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

`KittyPool:burnKittyCoin` always burns the msg.sender tokens

Summary

In the function KittyPool:burnKittyCoin we are always burning the msg.sender tokens rather than the address `_onBehalfOf`.

Vulnerability Details

https://github.com/Cyfrin/2024-08-kitty-fi/blob/950ac553b935a3bf9277b71ffa5662a84f2633fe/src/KittyPool.sol#L112C3-L115C6

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

Impact

We will always burn the `msg.sender` tokens. Resulting in unexpected behaviour and lose in users trust in the protocol.

Tools Used

Manual review.

Recommendations

Change the following lines to prevent always burning msg.sender tokens.

- i_kittyCoin.burn(msg.sender, _ameownt);
+ i_kittyCoin.burn(_onBehalfOf, _ameownt);
Updates

Lead Judging Commences

shikhar229169 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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