The access-control modifiers onlyRole and checkRole in LybraConfigurator.sol were implemented incorrectly, so they did not actually restrict callers. Any address could call sensitive functions such as initToken and setProtocolRewardsPool.
A malicious user can make the total supply and total shares of eUSD imbalanced by donating stETH to the protocol and then buying the fake income, causing later depositors to receive very few shares. The attacker can then redeem or liquidate other users without burning shares, stealing their stETH and the protocol's income.
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.
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.
The staking rewards contract computes each user's stake from borrowed EUSD and PeUSD across all vaults, but divides by only the EUSD total supply, so the numerator and denominator do not match. This inflates the reward rate and mints far more esLBR than intended.
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.
The mint function in LybraEUSDVaultBase lacks a check to prevent individual mint amounts from exceeding 10% of the total circulation when circulation reaches 10,000,000, contrary to the documented requirement. An attacker could mint a large amount, potentially manipulating the market or bypassing intended limits.
The rigidRedemption function lacks slippage protection, so a user's redemption can execute at a worse price than expected if the transaction is delayed. An attacker could exploit this by manipulating prices or delaying execution, causing the user to receive fewer tokens.
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.
The _repay function reduces poolTotalPeUSDCirculation by the full repayment amount, even though part of that amount is transferred as fees rather than burned. This understates the pool's circulation figure, affecting any logic that relies on it.
The staking contract calculated a user's LP value from the pair's raw token balances, which a flash loan could temporarily lower. An attacker could then claim rewards that should not have been claimable for a user who had staked enough LP.
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.
The governance contract used block.number as a clock, which on Arbitrum and Optimism does not track real time reliably. This could make timing-dependent governance logic behave incorrectly on those chains.
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.
The function that computes the bad collateral ratio subtracts a fixed value from the safe collateral ratio, but the safe ratio can be zero when default values are used, causing an underflow and a revert. This blocks the liquidation flow when default ratios are in effect.
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.
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.
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%.
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.
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's vault records the exact stETH amount deposited, ignoring Lido rebases. An attacker can deposit before a negative rebase and withdraw after, receiving the same stETH amount but more shares, causing the protocol to lose funds.
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.
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.
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.
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.
The esLBR token has a maximum supply, but the StakingRewardsV2 contract does not prevent the reward rate from causing total minted tokens to exceed that limit. If the maximum supply is reached, users cannot claim their earned rewards because the mint function will revert.
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.
LF
Lybra Finance
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.