Platform: Code4rena
Start Date: 24/03/2023
Pot Size: $49,200 USDC
Total HM: 20
Participants: 246
Period: 6 days
Judge: Picodes
Total Solo HM: 1
Id: 226
League: ETH
Rank: 235/246
Findings: 1
Award: $0.14
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: HHK
Also found by: 019EC6E2, 0Kage, 0x52, 0xRobocop, 0xTraub, 0xbepresent, 0xepley, 0xfusion, 0xl51, 4lulz, Bahurum, BanPaleo, Bauer, CodeFoxInc, Dug, HollaDieWaldfee, IgorZuk, Lirios, MadWookie, MiloTruck, RedTiger, Ruhum, SaeedAlipoor01988, Shogoki, SunSec, ToonVH, Toshii, UdarTeam, Viktor_Cortess, a3yip6, auditor0517, aviggiano, bearonbike, bytes032, carlitox477, carrotsmuggler, chalex, deliriusz, ernestognw, fs0c, handsomegiraffe, igingu, jasonxiale, kaden, koxuan, latt1ce, m_Rassska, n1punp, nemveer, nowonder92, peanuts, pontifex, roelio, rvierdiiev, shalaamum, shuklaayush, skidog, tank, teddav, top1st, ulqiorra, wait, wen, yac
0.1353 USDC - $0.14
RETH derivative uses uniswap v3 spot price which can be manipulated to steal from the pool
The ethPerDerivative
call in the underlyingValue
calculation uses the total amount currently deposited in the liquid staking derivative.
https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L73
This means that for RETH, when deposits are high, this would return poolPrice()
which is the uniswap v3 spot price. This price can be manipulated
https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L211-L216
https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/derivatives/Reth.sol#L228-L242
ethPerDerivative
for RETH would be small)Use an oracle for RETH price
#0 - c4-pre-sort
2023-04-04T11:23:28Z
0xSorryNotSorry marked the issue as duplicate of #601
#1 - c4-judge
2023-04-21T16:14:48Z
Picodes marked the issue as satisfactory
#2 - c4-judge
2023-04-21T16:15:28Z
Picodes marked the issue as duplicate of #1125
🌟 Selected for report: HHK
Also found by: 019EC6E2, 0Kage, 0x52, 0xRobocop, 0xTraub, 0xbepresent, 0xepley, 0xfusion, 0xl51, 4lulz, Bahurum, BanPaleo, Bauer, CodeFoxInc, Dug, HollaDieWaldfee, IgorZuk, Lirios, MadWookie, MiloTruck, RedTiger, Ruhum, SaeedAlipoor01988, Shogoki, SunSec, ToonVH, Toshii, UdarTeam, Viktor_Cortess, a3yip6, auditor0517, aviggiano, bearonbike, bytes032, carlitox477, carrotsmuggler, chalex, deliriusz, ernestognw, fs0c, handsomegiraffe, igingu, jasonxiale, kaden, koxuan, latt1ce, m_Rassska, n1punp, nemveer, nowonder92, peanuts, pontifex, roelio, rvierdiiev, shalaamum, shuklaayush, skidog, tank, teddav, top1st, ulqiorra, wait, wen, yac
0.1353 USDC - $0.14
The frxETH derivative uses price_oracle
of the curve pool which can be used to manipulate the slippage limits
The price_oracle()
in the Curve pool is an exponential moving average that exponentially converges from an old value to the last trade value. This is manipulatable in certain conditions. Someone can write a contract that flash-loans a large amount of token A (comparable to the amount of token A in a pool), swaps it for token B in the pool, swap the token B back to token A and repay the flash-loan. This would mean that the last price would significantly differ from the actual price. If there are no transactions on the pool for a while after this, then the pool's price_oracle()
would converge to a value close to this last price and hence, very different from the actual tokenA/tokenB price.
One key point here is that this kind of price manipulation doesn't require too many funds at risk (since the flashloan is paid up). The maximum loss for the exploiter would just be the fee on the flashloan and the two swaps.
An example of this manipulation for Curve v2 pools can be found in this repo https://github.com/shuklaayush/brownie-curve-v2
price_oracle
to converge to the crashed valueUse a proper oracle
#0 - c4-pre-sort
2023-04-02T10:31:58Z
0xSorryNotSorry marked the issue as low quality report
#1 - toshiSat
2023-04-10T14:20:37Z
Duplicate
#2 - c4-sponsor
2023-04-10T14:20:39Z
toshiSat marked the issue as sponsor confirmed
#3 - c4-judge
2023-04-20T09:53:54Z
Picodes marked the issue as satisfactory
#4 - c4-judge
2023-04-22T09:39:57Z
Picodes marked the issue as duplicate of #142
#5 - c4-judge
2023-04-24T21:37:58Z
Picodes changed the severity to 3 (High Risk)