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

Missing boundary check in USDV.sol #151

Open
code423n4 opened this issue Dec 24, 2021 · 2 comments
Open

Missing boundary check in USDV.sol #151

code423n4 opened this issue Dec 24, 2021 · 2 comments
Labels
bug Something isn't working G (Gas Optimization) USDV

Comments

@code423n4
Copy link
Contributor

Handle

p4st13r4

Vulnerability details

Impact

The claim function does not check if the provider index of the lock actually exists, leading to waste of gas for the transaction sender

Proof of Concept

https://github.com/code-423n4/2021-12-vader/blob/main/contracts/tokens/USDV.sol#L122

Tools Used

Editor

Recommended Mitigation Steps

Add this check

require(i < userLocks.length)
@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Dec 24, 2021
code423n4 added a commit that referenced this issue Dec 24, 2021
@0xstormtrooper
Copy link
Collaborator

Adding additional check may be waste of gas. Function will fail if i out of bounds here

https://github.com/code-423n4/2021-12-vader/blob/main/contracts/tokens/USDV.sol#L124

@0xstormtrooper 0xstormtrooper added the duplicate This issue or pull request already exists label Dec 27, 2021
@0xstormtrooper
Copy link
Collaborator

#106

@jack-the-pug jack-the-pug added 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments and removed 1 (Low Risk) Assets are not at risk. State handling, function incorrect as to spec, issues with comments labels Mar 13, 2022
@jack-the-pug jack-the-pug reopened this Mar 13, 2022
@liveactionllama liveactionllama removed the duplicate This issue or pull request already exists label Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working G (Gas Optimization) USDV
Projects
None yet
Development

No branches or pull requests

5 participants