This repository has been archived by the owner on Jul 14, 2024. It is now read-only.
coffiasd - AmoMinter borrow collateral assets can lead to protocol DOS #26
Labels
Non-Reward
This issue will not receive a payout
coffiasd
medium
AmoMinter borrow collateral assets can lead to protocol DOS
Summary
AmoMinter can borrow collateral token from pool , however not check unclaimed pool collateral which can lead to 3 external functions DOS:
Vulnerability Detail
admin can add
amoMinter
by invokingaddAmoMinter
https://github.com/sherlock-audit/2023-12-ubiquity/tree/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L608-L621
after
amoMinter
is added,amoMinter
protocol can borrow collateral asset from pool:https://github.com/sherlock-audit/2023-12-ubiquity/tree/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L574-L598
however the amount of collateral token
amoMinter
can borrow not checked , if the amount of collateral tokenamoMinter
borrow bigger thanbalanceOf(pool) - unclaimedPoolCollateral
can lead to DOS due to underflow panic.Here is my test written using foundry , let's assume:
then 3 external functions could be DOS
output:
Impact
3 external functions DOS:
admin have to deposit collateral token to pool without mint any dollar
Code Snippet
https://github.com/sherlock-audit/2023-12-ubiquity-coffiasd/tree/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L574-L598
Tool used
Foundry
Manual Review
Recommendation
the amount of collateral token
amoMinter
borrow should be checked not bigger thanbalanceOf(pool) -unclaimedPoolCollateral
Duplicate of #1
The text was updated successfully, but these errors were encountered: