Cyfrin / 2023-07-foundry-defi-stablecoin

37 stars 32 forks source link

Owner can mint without restriction #1114

Closed codehawks-bot closed 1 year ago

codehawks-bot commented 1 year ago

Owner can mint without restriction

Severity

High Risk

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DecentralizedStableCoin.sol

Summary

The Owner has the ability to mint without any restrictions for any account.

Vulnerability Details

This is seen in the mint function in DecentralizedStableCoin.sol

Impact

The Owner could mint to any account, no matter the health of that account, which could negatively impact the user's account health. This also causes issues that the owner could destabilize the coin by minting too much.

Tools Used

N/A

Recommendations

The owner should have restrictions on their ability to mint, at a minimum the account health should be checked when the owner is minting.

hans-cyfrin commented 1 year ago

It doesn't affect the user's health factor as s_DSCMinted isn't changed.