Platform: Code4rena
Start Date: 22/05/2024
Pot Size: $20,000 USDC
Total HM: 6
Participants: 126
Period: 5 days
Judge: 0xsomeone
Total Solo HM: 1
Id: 379
League: ETH
Rank: 70/126
Findings: 1
Award: $0.01
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Circolors
Also found by: 0rpse, 0x175, 0xAadi, 0xHash, 0xMax1mus, 0xMosh, 0xblack_bird, 0xdice91, 0xfox, 0xhacksmithh, 0xloscar01, 0xrex, 4rdiii, Audinarey, AvantGard, Bigsam, DPS, Dots, Drynooo, Dudex_2004, Evo, Kaysoft, King_, Limbooo, MrPotatoMagic, PENGUN, Sabit, SovaSlava, SpicyMeatball, TheFabled, Utsav, Varun_05, Walter, adam-idarrha, araj, aslanbek, ayden, bctester, biakia, bigtone, brgltd, carrotsmuggler, cats, crypticdefense, dd0x7e8, dhank, fandonov, fyamf, grearlake, iamandreiski, ilchovski, jasonxiale, joaovwfreire, lanrebayode77, m4ttm, merlinboii, niser93, nnez, octeezy, oxchsyston, pamprikrumplikas, rouhsamad, tedox, trachev, turvy_fuzz, twcctop, yotov721, zhaojohnson
0.0056 USDC - $0.01
https://github.com/code-423n4/2024-05-munchables/blob/57dff486c3cd905f21b330c2157fe23da2a4807d/src/managers/LockManager.sol#L275-L294 https://github.com/code-423n4/2024-05-munchables/blob/57dff486c3cd905f21b330c2157fe23da2a4807d/src/managers/LockManager.sol#L311-L398
Let's say there is a scenario where Bob locks very small amounts on behalf of Alice and he resets Alice's unlock time every time. This will lead to Alice not being able to unlock and withdraw her funds.
There is a user called Bob. He locks very small amounts for example 1 wei on behalf of Alice in the lockOnBehalf
function. The lockOnBehalf
function then calls the _lock
function which executes the locking of the funds. The problem lies in the _lock
function because every time there are new funds locked the unlockTime
gets reset with the next line:
lockedToken.unlockTime = uint32(block.timestamp) + uint32(_lockDuration);
Bob can lock on behalf of Alice very small amounts very often and he can reset Alice's unlock time every time he does this. This can lead to Alice not being able to withdraw her funds because if Bob does that, the unlock time won't pass and now Alice has a lot of locked funds which she can't unlock.
Manual Review
Put a minimum deposit amount so if some user wants to DoS someone else he will need to lose a lot of funds or consider not resetting the unlock time if someone locks on behalf of someone else.
DoS
#0 - c4-judge
2024-06-05T12:59:00Z
alex-ppg marked the issue as satisfactory