Lybra Finance - ke1caM's results

A protocol building the first interest-bearing omnichain stablecoin backed by LSD.

General Information

Platform: Code4rena

Start Date: 23/06/2023

Pot Size: $60,500 USDC

Total HM: 31

Participants: 132

Period: 10 days

Judge: 0xean

Total Solo HM: 10

Id: 254

League: ETH

Lybra Finance

Findings Distribution

Researcher Performance

Rank: 98/132

Findings: 1

Award: $29.06

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: KupiaSec

Also found by: 0xRobocop, 0xkazim, Co0nan, DedOhWale, Hama, Inspecktor, Kenshin, KupiaSec, LaScaloneta, Toshii, ke1caM, yudan

Labels

bug
2 (Med Risk)
satisfactory
duplicate-773

Awards

29.0567 USDC - $29.06

External Links

Lines of code

https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L73-L77 https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/esLBRBoost.sol#L37-L45 https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L87-L98

Vulnerability details

When user calls stake function in ProtocolRewardsPool.sol user's LBR token is burned and esLBR token is minted. However, user's lock status is never set. Unstake function expects user to have an unlockTime but for not existing address in mapping, return value is zero, so the esLBRBoost.getUnlockTime will be 0. As in the requirements for user to convert esLBR to LBR according to comments in file "The current time must be greater than the unlock time retrieved from the boost contract for the user". This requirement will always pass.

Impact

Protocol functionality may be omitted.

Proof of Concept

setLockStatus is implemented but never used https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/esLBRBoost.sol#L37-L45 unStake function uses esLBRBoost.getUnlockTime(msg.sender) https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L87-L98

Tools Used

Manual analysis, Vscode

Implement setLockStatus in stake function to keep track of user's data about lock status

Assessed type

Other

#0 - c4-pre-sort

2023-07-11T00:08:14Z

JeffCX marked the issue as duplicate of #838

#1 - c4-judge

2023-07-28T13:06:46Z

0xean marked the issue as duplicate of #773

#2 - c4-judge

2023-07-28T15:38:26Z

0xean marked the issue as satisfactory

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