it frxETHToken was approved, if approved succeed that would generated into sfrxETH. on that line 78. sfrxeth_recieved but store sfrxETHToken.deposit instead of frxETHToken.deposit. it may lead into wrong return since it should be frxETHToken into sfrxETHToken first
This can be lead into this scene :
Alice approve that want to deposit frxETHToken into sfrxETHToken
Alice want to deposit of frxETHToken (let's say 1million frxETHToken)
Alice can't got sfrxETHToken, eversince contract can't generated how many that frxETHToken was deposit into sfrxETHToken address.
Alice got losses her fund.
Tools Used
Manual Review
Recommended Mitigation Steps
Recommended that dev, use frxETHToken.deposit to verify that user got their frxETHToken staked and got their sfrxETHToken in return.
Lines of code
https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/frxETHMinter.sol#L78 https://github.com/code-423n4/2022-09-frax/blob/55ea6b1ef3857a277e2f47d42029bc0f3d6f9173/src/frxETHMinter.sol#L75
Vulnerability details
Impact
Whoever was deposit
frxETHToken
user was freeze into the contract and loss of user fund.Proof of Concept
on that line of :
it frxETHToken was approved, if approved succeed that would generated into sfrxETH. on that line 78. sfrxeth_recieved but store
sfrxETHToken.deposit
instead offrxETHToken.deposit
. it may lead into wrong return since it should be frxETHToken into sfrxETHToken firstThis can be lead into this scene :
Tools Used
Manual Review
Recommended Mitigation Steps
Recommended that dev, use
frxETHToken.deposit
to verify that user got their frxETHToken staked and got their sfrxETHToken in return.