Closed sherlock-admin2 closed 10 months ago
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
The issue describes about DOSing setPool function by manipulating the Curve pool, but it's assumed that the Curve pool deployment, LP deposit, and setPool will be handled in one tx using multicall structure
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
The issue describes about DOSing setPool function by manipulating the Curve pool, but it's assumed that the Curve pool deployment, LP deposit, and setPool will be handled in one tx using multicall structure
infect3d
medium
LibTWAPOracle.setPool can be DoS'd by sending 1 wei to imbalance pools reserves
Summary
It is cheap and easy to DoS/prevent the setting of a pool as an oracle
Vulnerability Detail
the
setPool
function is used to set a Curve MetaPool as the TWAP oracle reference. There's multiple sanity checks performed inside, one of them ensuring that the reserve of both tokens is the same. It make the call vulnerable to DoS front-running by sending 1 wei of any of both tokens to imbalance the pool and make the call revert. Also, if you check the different MetaPools, you'll see that reserves aren't balanced.Impact
Not allowing to set up the oracle
Code Snippet
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibTWAPOracle.sol#L52
Tool used
Manual Review
Recommendation
There is no reason to ensure balances are perfect in the pool, as this is only true at the very beginning of the existence of the pool. Any first trade will imbalance the reserves.
Duplicate of #14