No need to stack lend pool to take lendlaunger rewards #435
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-416
satisfactory
satisfies C4 submission criteria; eligible for awards
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2023-08-verwa/blob/498a3004d577c8c5d0c71bff99ea3a7907b5ec23/src/LendingLedger.sol#L129-L143
Vulnerability details
Impact
Lending lenger give reward tokens to users if they lend their tokens to selected pools. Lendingledger give rewards as weekly and it records user's balance until end of the week(espacially thursday because 1 jan 1970 was thursday). But protocol records can be any record in the week anyvalue, protocol just look at the latest updated value in this week . In short a user can withdraw his tokens after thursday but if he stake his token before next thursday 00.00 he will benefit from tokens like stake tokens all week.
Proof of Concept
https://imgur.com/a/qIrEoOa
pls paste this test to lendingLEdgerTest.sol and it can be seen that a malicious user can take same reward like all time staker when just stake his token just for two block time.
Tools Used
Recommended Mitigation Steps
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: