Skip to content

Code4rena

Frax Ether Liquid Staking contest

Every publicly disclosed report for Frax Ether Liquid Staking contest and what kind of bugs they were.

disclosed reports
27
most reported class
Business logic
bug classes found
5
first disclosure
2022
Find Frax Ether Liquid Staking contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Frax Ether Liquid Staking contest chose to make public.

Business logic

Liquidator might end up paying much more asset than collateral received

The liquidateClean function does not verify that the repaid shares are fully covered by the available collateral, so a liquidator can repay more than the collateral is worth and receive only the available collateral. This can cause the liquidator to lose funds, especially if a validator reorders transactions to front-run a well-calculated liquidation.

Frax Ether Liquid Staking contest

Medium
Access control

FraxlendPair#setTimeLock: Allows the owner to reset TIME LOCK ADDRESS

The setTimeLock function allows the owner to change the TIME_LOCK_ADDRESS multiple times, even though the code comments indicate it should be a constant/immutable value. An attacker with owner privileges could reset the timelock address whenever they want, which is not the expected behaviour.

Frax Ether Liquid Staking contest

Medium
Smart contracts

FraxlendPair.sol is not fully EIP-4626 compliant

The contract's maxDeposit and maxMint functions always return a fixed maximum value, even when the contract is paused and deposits and mints are disabled. This breaks the EIP-4626 standard, which could break composability with other contracts and potentially lead to loss of funds.

Frax Ether Liquid Staking contest

Medium
Business logic

Decimals limitation limits the tokens that can be used

The contract's oracle normalisation formula can underflow when the asset's decimals exceed 18 plus the collateral's decimals, causing a revert. This prevents deployment of certain token pairs, such as those with USDC and tokens with more than 24 decimals.

Frax Ether Liquid Staking contest

Medium
Business logic

Fraxlend pair deployment can be front-run by a custom pair deployment

The FraxlendPairDeployer contract uses a salt derived from a seed and config data to prevent duplicate pair deployments, but a whitelisted user can front-run a standard deployment by calling deployCustom with a name that produces the same salt, causing the honest deployment to revert. The attacker can also use the same name to trigger a revert in _deploySecond, blocking the deployment.

Frax Ether Liquid Staking contest

Medium
Business logic

Wrong percent for FraxlendPairCore.dirtyLiquidationFee .

The dirty liquidation fee was calculated using a constant of 9000 instead of 90000, so the resulting fee was 9% of the clean fee rather than the intended 90%. This made the fee charged on dirty liquidations far lower than designed.

Frax Ether Liquid Staking contest

Medium
Business logic

FraxlendPair.changeFee() doesn’t update interest before changing fee.

The changeFee() function updates the protocol fee without first accruing interest, so when interest is later calculated, the new fee is applied retroactively to the period before the change. This can cause the protocol to receive an incorrect fee amount, potentially higher than intended.

Frax Ether Liquid Staking contest

Medium
DoS

Impossible to setCreationCode() with code size less than 13K

The contract deployer assumes the pair creation code is always at least 13,000 bytes, so setting a smaller creation code causes a slice operation to fail and a later read from an address with no code to underflow. An attacker could not exploit this directly, but the owner would be unable to deploy a smaller, optimised pair contract.

Frax Ether Liquid Staking contest

Medium
DoS

Denial of service in globalPause by wrong logic

The globalPause function in FraxlendPairDeployer.sol returns an uninitialized array, causing the transaction to fault when called. An attacker with the circuit breaker role could not use it to pause all pairs at once, but the impact is limited because individual pairs can still be paused.

Frax Ether Liquid Staking contest

Medium
Business logic

Any borrower with bad debt can be liquidated multiple times to lock funds in the lending pair

Leftover shares in liquidateClean are only subtracted from pair totals, not from the borrower's borrowed shares, so a borrower with bad debt can be liquidated repeatedly with zero shares to write off debt and corrupt pair accounting. This can lock the pool, prevent borrowers from repaying, and severely reduce lenders' withdrawals.

Frax Ether Liquid Staking contest

High
Business logic

No incentives to write off bad debt when remaining collateral is very small

The report argues that when a liquidation leaves only a tiny amount of collateral, the remaining reward is smaller than the gas cost, so nobody is incentivised to finish the clean liquidation and the bad debt is never written off. The text claims this can leave a pair toxic, with the last user bearing the leftover borrow shares.

Frax Ether Liquid Staking contest

Medium
Business logic

Penalty rate is used for pre-maturity date as well

When interest is added after the maturity date, the penalty rate is applied to the entire period since the last interest update, including the time before maturity. This causes borrowers to be charged more interest than intended.

Frax Ether Liquid Staking contest

Medium
Business logic

Withheld ETH shoud not be sent back to the frxETHMinter contract itself

The frxETHMinter contract's moveWithheldETH and recoverEther functions allow the owner to send withheld ETH back to the contract itself, which triggers the receive function and mints new frxETH, duplicating the accounting of ETH already converted. This breaks the 1:1 ETH:frxETH peg.

Frax Ether Liquid Staking contest

Medium
DoS

frxETHMinter.depositEther may run out of gas, leading to lost ETH

The depositEther function loops over all possible deposits based on the contract's balance, which can exceed the block gas limit when a large amount of ETH is deposited, making the function unusable and trapping the ETH. An attacker could deposit a large amount of ETH to cause this denial of service, preventing further deposits and requiring emergency failover.

Frax Ether Liquid Staking contest

Medium
Business logic

sfrxETH: The volatile result of previewMint() may prevent mintWithSignature from working

The previewMint() function's result changes with contract state, making the amount volatile in mintWithSignature when approveMax is false. A user's signed transaction can revert if a prior transaction in the same block alters the state so that previewMint(shares) differs from the signed amount.

Frax Ether Liquid Staking contest

Medium
Business logic

frxETHMinter: Non-conforming ERC20 tokens not recoverable

The contract's token recovery function assumes every token returns a boolean on transfer, so tokens like USDT that return nothing cause the call to revert. An attacker cannot exploit this, but accidentally sent non-conforming tokens become permanently stuck.

Frax Ether Liquid Staking contest

Medium
DoS

getNextValidator() error could temporarily make depositEther() inoperable

The depositEther() function reverts if a validator's public key has already been used, because the code checks activeValidators[pubKey] and reverts. An attacker could cause a temporary denial of service by making a validator key be reused, blocking deposits until governance removes the bad validator.

Frax Ether Liquid Staking contest

Medium
DoS

removeValidator() and removeMinter() may fail due to exceeding gas limit

The removeValidator and removeMinter functions use unbounded loops over arrays that can grow large, so calling them may fail if the array size makes the transaction exceed the block gas limit. An attacker could potentially cause these functions to become unusable by increasing the array size, though the report does not demonstrate a concrete attack.

Frax Ether Liquid Staking contest

Medium
Smart contracts

frxETH can be depegged due to ETH staking balance slashing

The frxETH token is meant to be pegged to ETH, but if the underlying ETH staking validators are slashed, the protocol has no mechanism to maintain the peg or the minimum 32 ETH staking balance. An attacker could exploit this by causing validators to be slashed, leading to frxETH depegging.

Frax Ether Liquid Staking contest

Medium
Access control

Centralization risk: admin have privileges: admin can set address to mint any amount of frxETH, can set any address as validator, and change important state in frxETHMinter and withdraw fund from frcETHMinter

The frxETH smart contracts give a privileged admin (owner or timelock) the power to mint unlimited frxETH, add or remove validators, change critical state, and withdraw all ETH or ERC20 tokens from the minter contract. A malicious or compromised admin could therefore rug pull the protocol and take user funds.

Frax Ether Liquid Staking contest

Medium
Business logic

Rewards delay release could cause yields steal and loss

The vault's reward accounting delays recording newly generated yield until syncRewards is called, so a user can time deposits and redemptions to capture yield that belongs to others. An attacker could front-run a large withdrawal with syncRewards and a deposit, then redeem after one cycle to steal a portion of the victim's yield.

Frax Ether Liquid Staking contest

Medium
Race condition

Frontrunning by malicious validator

A malicious validator can front-run a deposit transaction for its public key by depositing a small amount with different withdrawal credentials, causing the later large deposit to retain the attacker's withdrawal credentials. This could allow the attacker to control the withdrawal of the larger deposit.

Frax Ether Liquid Staking contest

High