Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An attacker can extend lock duration for other users #618

Open
c4-bot-7 opened this issue May 27, 2024 · 0 comments
Open

An attacker can extend lock duration for other users #618

c4-bot-7 opened this issue May 27, 2024 · 0 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working 🤖_05_group AI based duplicate group recommendation

Comments

@c4-bot-7
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2024-05-munchables/blob/57dff486c3cd905f21b330c2157fe23da2a4807d/src/managers/LockManager.sol#L382

Vulnerability details

Impact

Detailed description of the impact of this finding.

Impact

attacker can extend users lock duration by lockOnBehalf.

Proof of Concept

an attacker can call _lockRecipient for other user address with low amounts of _quantity, causing lockedToken.unlockTime to be increased.

look at code below:

lockedToken.lastLockTime = uint32(block.timestamp);
        lockedToken.unlockTime =
            uint32(block.timestamp) +
            uint32(_lockDuration);

Tools Used

Manual Review

Recommended Mitigation Steps

Allow only msg.sender to call _lock

Proof of Concept

Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.

Tools Used

Recommended Mitigation Steps

Assessed type

Other

@c4-bot-7 c4-bot-7 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels May 27, 2024
c4-bot-7 added a commit that referenced this issue May 27, 2024
@c4-bot-12 c4-bot-12 added the 🤖_05_group AI based duplicate group recommendation label May 27, 2024
howlbot-integration bot added a commit that referenced this issue May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working 🤖_05_group AI based duplicate group recommendation
Projects
None yet
Development

No branches or pull requests

2 participants