Skip to content

Code4rena

Lybra Finance

Every publicly disclosed report for Lybra Finance and what kind of bugs they were.

disclosed reports
31
most reported class
Business logic
bug classes found
5
first disclosure
2023
Find Lybra Finance on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Lybra Finance chose to make public.

Business logic

Wrong proposalThreshold amount in LybraGovernance.sol

The governance contract's proposal threshold was set to 100,000 esLBR instead of the documented 10,000,000 esLBR. An attacker with only 100,000 esLBR delegated could create proposals, bypassing the intended requirement.

Lybra Finance

Medium
Business logic

Allowing refreshReward() to fail during minting or buring esLBR could result in gain or loss previously earned reward

The esLBR token's mint and burn functions use a try-catch around refreshReward(), so if that call fails, the reward accounting is not updated. An attacker could mint more esLBR while refreshReward is unavailable, then later call refreshReward to record rewards based on the increased balance, gaining more rewards than deserved; similarly, a victim's burn could be back-run to reduce their recorded rewards.

Lybra Finance

Medium
Business logic

Rewards for initial period can be lost in all of the synthetix derivative contracts

The reward contracts start the reward period when the owner calls notifyRewardAmount, but if no one has staked yet, the rewards for the initial period are not distributed and remain stuck in the contract. An attacker could exploit this by delaying their stake to cause a portion of rewards to be lost, though the report does not describe a direct theft.

Lybra Finance

Medium
Business logic

Fixed reward percentage for liquidators in the eUSD vault may cause a liquidation crisis

The liquidation function in the eUSD vault gives a fixed 10% reward to liquidators, which can reduce the collateral ratio of an already undercollateralised position (below 110%) after liquidation. An attacker could repeatedly liquidate such a position, making it unhealthier and potentially causing bad debt for the protocol.

Lybra Finance

Medium
Business logic

Lack of timelock on rigidRedemption , enables to steal yield from other users

The rigidRedemption function lacks the time-based softlock applied to withdraw, allowing a user to deposit just before a rebase, redeem most collateral immediately, and capture yield generated by others. The attacker can then withdraw the remaining collateral and use the rebase to recover fees, leaving with a profit.

Lybra Finance

Medium
Business logic

_voteSucceeded() returns true when againstVotes > forVotes and vice versa

The governance contract's vote success check compared the against-votes tally against the for-votes tally in the wrong order, so a proposal with more against votes than for votes would be considered successful. An attacker could therefore pass a proposal that the majority opposed.

Lybra Finance

High
Smart contracts

Incorrect function call in LybraRETHVault ’s getAssetPrice

The LybraRETHVault contract calls a non-existent function getExchangeRatio() on the rETH contract, so the asset price cannot be calculated. This would halt all operations that depend on asset pricing.

Lybra Finance

Medium
DoS

Impossibility to change safeCollateralRatio

The vault's vaultType variable is internal, so the configurator's staticcall to read it reverts, making it impossible to change the safeCollateralRatio. This could become critical when market conditions change, such as a drop in ETH price.

Lybra Finance

Medium
Business logic

LybraPeUSDVaultBase.rigidRedemption should use getBorrowedOf instead of borrowed

The rigidRedemption function uses the borrowed mapping instead of getBorrowedOf, which excludes fees, so the debt check and collateral ratio are understated. An attacker could redeem more than allowed and perform redemptions even when the provider's actual collateral ratio is below 100%.

Lybra Finance

Medium
Business logic

stakerewardV2pool.withdraw() should check the user’s boost lock status.

The withdraw function in the staking pool does not check whether the user's boost lock period has ended, so a user can stake, set the longest lock for the highest boost, and then immediately withdraw all funds while still earning boosted rewards. This lets them collect extra rewards without keeping funds locked as intended.

Lybra Finance

Medium
Business logic

Invalid implementation of prioritized token rewards distribution

The reward distribution function in the ProtocolRewardsPool contract fails to correctly calculate and transfer rewards because it attempts to send EUSD when the contract lacks sufficient balance, and it mishandles decimal conversion when transferring stablecoin rewards. As a result, users cannot claim their rewards and the rewards become frozen.

Lybra Finance

Medium
Access control

There is a vulnerability in the executeFlashloan function of the PeUSDMainnet contract. Hackers can use this vulnerability to burn other people’s eUSD token balance without permission

The executeFlashloan function lets the caller name any receiver, and the flash loan fee is burned from that receiver's eUSD balance without their consent. An attacker could therefore burn a large amount of another user's eUSD by choosing a receiver with a fallback function and a large loan amount.

Lybra Finance

High
Business logic

doesn’t calculate the current borrowing amount for the provider, including the provider’s borrowed shares and accumulated fees due to inconsistency in collateralRatio calculation

The collateral ratio calculation in the rigidRedemption function uses only the borrowed amount, ignoring borrowed shares and accumulated fees, unlike the liquidation function which uses getBorrowedOf. This inconsistency could allow a provider to redeem more than they should, potentially causing a loss to the protocol.

Lybra Finance

High
Audit finding

EUSD.mint function wrong assumption of cases when calculated sharesAmount = 0

The EUSD.mint function assumes that a calculated sharesAmount of zero only occurs when totalSupply is zero, but integer division can also produce zero when totalSupply is non-zero. An attacker could mint a small amount of eUSD to receive a disproportionately large number of shares, profiting from the inflated share price.

Lybra Finance

High
Business logic

Governance wrongly calculates _quorumReached()

The governance contract's quorum check sums against and abstain votes instead of all votes cast, so quorum is only reached when at least a third of votes are against or abstain. This can prevent legitimate proposals with mostly for votes from passing.

Lybra Finance

High
Business logic

Incorrect Reward Distribution Calculation in ProtocolRewardsPool

The ProtocolRewardsPool contract's getReward() function compares the number of eUSD shares held by the contract with the reward amount, but shares are worth more than 1 eUSD each. This can cause users to receive far more eUSD than their actual reward.

Lybra Finance

Medium