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

Unable to release funds deposited through Lock-extendLock #560

Closed
code423n4 opened this issue Dec 16, 2022 · 2 comments
Closed

Unable to release funds deposited through Lock-extendLock #560

code423n4 opened this issue Dec 16, 2022 · 2 comments
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-23 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/588c84b7bb354d20cbca6034544c4faa46e6a80e/contracts/Lock.sol#L89-L91
https://github.com/code-423n4/2022-12-tigris/blob/588c84b7bb354d20cbca6034544c4faa46e6a80e/contracts/Lock.sol#L103

Vulnerability details

Impact

Users depositing tig assets to the bondNFT through the Lock contract could find themselves unable to release their funds.
The only explanation the user would receive is an "Arithmetic over/underflow" error.
This issue greatly deteriorates the user experience and usability of the platform.

Issue arises from the Lock-extendLock function not updating the totalLocked value for that particular tig asset. source
This leads to Lock-release underflowing when the user tries to release their funds after the duration of the lock has passed. source

Proof of Concept

Foundry project directory which includes the failing test: https://github.com/sha256yan/tig
Failing test is located in test/Lock.t.sol permalink

Tools Used

Foundry-rs

Recommended Mitigation Steps

Remove the totalLocked mapping all-together, or keep it and update it in extendLock().

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Dec 16, 2022
code423n4 added a commit that referenced this issue Dec 16, 2022
@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as duplicate of #23

@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate-23 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants