code-423n4 / 2022-04-jpegd-findings

1 stars 1 forks source link

Exposed public `burn()` for stablecoins . #220

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/code-423n4/2022-04-jpegd/blob/e72861a9ccb707ced9015166fbded5c97c6991b6/contracts/tokens/StableCoin.sol#L19

Vulnerability details

Impact

User can accidentally burn PUSD tokens.

Proof of Concept

PUSD Coin inherits from ERC20Burnable which according to OZ ` /**

I believe that this functionality makes no sense for a stable coin. It is just dangerous and can make users lose their funds.

Tools Used

Manual code review

Recommended Mitigation Steps

Remove the ERC20Burnable.

spaghettieth commented 2 years ago

There's no way a user would call burn without knowing what it does.

dmvt commented 2 years ago

If the user calls burn, they clearly intend to burn their tokens.