Frax Ether Liquid Staking contest - Ch_301's results

A liquid ETH staking derivative designed to uniquely leverage the Frax Finance ecosystem.

General Information

Platform: Code4rena

Start Date: 22/09/2022

Pot Size: $30,000 USDC

Total HM: 12

Participants: 133

Period: 3 days

Judge: 0xean

Total Solo HM: 2

Id: 165

League: ETH

Frax Finance

Findings Distribution

Researcher Performance

Rank: 22/133

Findings: 2

Award: $156.95

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: __141345__

Also found by: Bahurum, Ch_301, Chom, Respx, Trust, datapunk, ronnyx2017

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed
syncRewards sniping

Awards

128.9427 USDC - $128.94

External Links

Lines of code

https://github.com/code-423n4/2022-09-frax/blob/main/src/frxETHMinter.sol#L177-L178 https://github.com/code-423n4/2022-09-frax/blob/main/src/frxETHMinter.sol#L87 https://github.com/corddry/ERC4626/blob/643cd044fac34bcbf64e1c3790a5126fec0dbec1/src/xERC4626.sol#L78-L97

Vulnerability details

Impact

malicious users will steal the rewards from the vault sfrxETH.sol

Proof of Concept

On frxETHMinter.sol: submitPaused == true for the last three weeks. so no one can _submit() eth even to convert rewards by Multisig Treasury Contract
All these rewards for the past 3 weeks are staked on the Multisig Treasury Contract

On sfrxETH.sol: syncRewards() was invoked three times (as we know Multisig Treasury Contract have no frxETH to transfer it).

On frxETHMinter.sol: At the end of the fourth week, submitPaused will be submitPaused == false So now Multisig Treasury Contract can convert ETH to frxETH At the same time, Alice will submit() an amount of ETH

On sfrxETH.sol: When (block.timestamp > rewardsCycleEnd) == true And before invoking syncRewards() by anyone or the bot (or the bot is not working) Alice will deposit() or mint() all the frxETH to sfrxETH Now after one-day syncRewards() is invoked successfully Alice now can redeem() or withdraw() with a higher exchange rate and steal the reward of the last month even though he only was deposited yesterday in the vault

In case the submitPaused == true for long time The Multisig Treasury Contract need to be only able to _submit() And then someone needs to invoke syncRewards() After that opens, the _submit() for the public users

#0 - FortisFortuna

2022-09-26T17:15:00Z

From @denett syncRewards should be called by us at the beginning of each period, or we need to automatically call it before deposits/withdrawals.

#1 - FortisFortuna

2022-09-26T17:30:00Z

Use effects-Interactions Pattern

Set it to true before the deposit

Finding

File: /src/frxETHMinter.sol activeValidators[pubKey] = true;

https://github.com/code-423n4/2022-09-frax/blob/main/src/frxETHMinter.sol#L151

Unnecessary checking for zero value

the deposit() on ERC4626 checked it on the top of the function

Finding

File: /src/frxETHMinter.sol require(sfrxeth_recieved > 0, 'No sfrxETH was returned');

https://github.com/code-423n4/2022-09-frax/blob/main/src/frxETHMinter.sol#L79

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter