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

setLockDuration doesn't have unlockTimeLatest controls #425

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

setLockDuration doesn't have unlockTimeLatest controls #425

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 🤖_primary AI based primary recommendation 🤖_53_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/#L245

Vulnerability details

Impact

User's tokens can are frozen for extended periods of time without their possible knowledge or control.

Proof of Concept

  • User calls setLockDuration to lock tokens for 5 days
  • gas price goes up and tx doesn't execute for 2 days.
  • It then executes due to lowered gas price
  • Now comes day 5 when user needs her tokens. But she cannot unlock for 2 more days.
  • User has some loans and they will get liquidated due to missing collateral.

This is temporary Freezing of Funds which is a high issue. The probability of it happening is medium, because transactions get delayed in the mempool all the time.

This kind of issue has been confirmed medium recently.

Tools Used

Recommended Mitigation Steps

Add a unlockTimeLatest deadline parameter for the locking function. Fill it with some reasonable deadline, eg 1 hour from tx submission time.

Assessed type

Invalid Validation

@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 🤖_53_group AI based duplicate group recommendation 🤖_primary AI based primary recommendation labels May 27, 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 🤖_primary AI based primary recommendation 🤖_53_group AI based duplicate group recommendation
Projects
None yet
Development

No branches or pull requests

2 participants