Algo Ssstablecoinsss

AI First Flight #2
Beginner FriendlyDeFi
EXP
View results
Submission Details
Impact: medium
Likelihood: low
Invalid

No Maximum Debt Limit Per U

Root + Impact

Description

  • * Users can mint DSC tokens as long as they maintain a health factor >= 1.0. There are no limits on the total amount of DSC a single user can mint.

    * The protocol doesn't implement a maximum debt cap per user. Malicious users could deposit large amounts of collateral and mint extremely large amounts of DSC, potentially causing gas issues, manipulation of protocol economics, or DoS attacks.

    ```vyper

    @internal

    def _mint_dsc(amount_dsc_to_mint: uint256):

    assert amount_dsc_to_mint > 0, "DSCEngine__NeedsMoreThanZero"

    self.user_to_dsc_minted[msg.sender] += amount_dsc_to_mint // @> No maximum limit check

    self._revert_if_health_factor_is_broken(msg.sender)

    success: bool = extcall DSC.mint(msg.sender, amount_dsc_to_mint)

    assert success, "DSCEngine__MintFailed"

    ```


Risk

Likelihood:

  • * Whales or coordinated groups could deposit large amounts of collateral to mint massive DSC positions

    * Flash loan attacks could temporarily create extremely large positions

    * Protocol upgrades or admin functions that iterate over users could become prohibitively expensive

Impact:

  • * Gas griefing attacks if protocol needs to iterate over all users

    * Large positions could manipulate protocol economics and token price

    * DoS risk if any function needs to process all user positions

    * Concentration risk if a single user holds too much of the total supply

Proof of Concept

```python
# Scenario:
# 1. Attacker deposits $100M worth of collateral
# 2. Mints $50M worth of DSC (maintaining HF >= 1.0)
# 3. Attacker now controls 50%+ of DSC supply
# 4. Can manipulate DSC price and protocol economics
# 5. Any admin function that iterates users becomes expensive
```

Recommended Mitigation

```diff
+MAX_DEBT_PER_USER: public(constant(uint256)) = 10_000_000 * 10**18 # $10M maximum
@internal
def _mint_dsc(amount_dsc_to_mint: uint256):
assert amount_dsc_to_mint > 0, "DSCEngine__NeedsMoreThanZero"
+ assert self.user_to_dsc_minted[msg.sender] + amount_dsc_to_mint <= MAX_DEBT_PER_USER, "DSCEngine__ExceedsMaxDebt"
self.user_to_dsc_minted[msg.sender] += amount_dsc_to_mint
self._revert_if_health_factor_is_broken(msg.sender)
success: bool = extcall DSC.mint(msg.sender, amount_dsc_to_mint)
assert success, "DSCEngine__MintFailed"
```
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge 16 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!