code-423n4 / 2021-04-marginswap-findings

1 stars 0 forks source link

PriceAware uses prices from getAmountsOut #39

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Vulnerability details

getPriceFromAMM relies on values returned from getAmountsOut which can be manipulated (e.g. with the large capital or the help of flash loans). The impact is reduced with UPDATE_MIN_PEG_AMOUNT and UPDATE_MAX_PEG_AMOUNT, however, it is not entirely eliminated.

Impact

Email address

pauliax6@gmail.com

Handle

paulius.eth

Eth address

0x523B5b2Cc58A818667C22c862930B141f85d49DD

Recommended mitigation steps

Uniswap v2 recommends using their TWAP oracle: https://uniswap.org/docs/v2/core-concepts/oracles/