This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
hash - Incorrect ProtocolOwnedLiquidityOhm calculation due to inclusion of other user's reserves #172
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
hash
high
Incorrect ProtocolOwnedLiquidityOhm calculation due to inclusion of other user's reserves
Summary
ProtocolOwnedLiquidityOhm for Bunni can include the liquidity deposited by other users which is not protocol owned
Vulnerability Detail
The protocol owned liquidity in Bunni is calculated as the sum of reserves of all the BunniTokens
The deposit function of Bunni allows any user to add liquidity to a token. Hence the returned reserve will contain amounts other than the reserves that actually belong to the protocol
Impact
Incorrect assumption of the protocol owned liquidity and hence the supply. An attacker can inflate the liquidity reserves
The wider system relies on the supply calculation to be correct in order to perform actions of economical impact
Code Snippet
POL liquidity is calculated as the sum of bunni token reserves
https://github.com/sherlock-audit/2023-11-olympus/blob/9c8df76dc9820b4c6605d2e1e6d87dcfa9e50070/bophades/src/modules/SPPLY/submodules/BunniSupply.sol#L171-L191
BunniHub allows any user to deposit
https://github.com/sherlock-audit/2023-11-olympus/blob/9c8df76dc9820b4c6605d2e1e6d87dcfa9e50070/bophades/src/external/bunni/BunniHub.sol#L71-L106
Tool used
Manual Review
Recommendation
Guard the deposit function in BunniHub or compute the liquidity using shares belonging to the protocol
The text was updated successfully, but these errors were encountered: