-
Notifications
You must be signed in to change notification settings - Fork 3
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
Incorrect approve call #1838
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
duplicate-1782
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Comments
code423n4
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
Sep 5, 2023
bytes032 marked the issue as duplicate of #928 |
c4-pre-sort
added
duplicate-928
sufficient quality report
This report is of sufficient quality
labels
Sep 8, 2023
bytes032 marked the issue as sufficient quality report |
bytes032 marked the issue as not a duplicate |
bytes032 marked the issue as duplicate of #1455 |
bytes032 marked the issue as duplicate of #1782 |
GalloDaSballo marked the issue as unsatisfactory: |
c4-judge
added
the
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
label
Oct 12, 2023
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
duplicate-1782
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/amo/UniV2LiquidityAmo.sol#L200
Vulnerability details
Impact
Hanging approval, for tokenAAmount - tokenAAmountMin amount, next addLiquidity call will fail for tokens like USDT, because it will try to set new approval, without resetting it to 0 first
Proof of Concept
Here, it is not guaranteed that tokenAAmount of amount will be used up in add liquidity call since tokenAAmountMin is minimum which is guaranteed to be used. Hence, this will lead to hanging approval for tokenAAmount - tokenAAmountMin, and when next call happen for addLiquidity again, for tokens like USDT it will fail, because current UDST approval is non zero, and when again a non zero approve call happen, it will fail.
Tools Used
VS Code
Recommended Mitigation Steps
Assessed type
Error
The text was updated successfully, but these errors were encountered: