-
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
Impossible to change addresses twice #1455
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-1662
low quality report
This report is of especially low 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
low quality report
This report is of especially low quality
labels
Sep 8, 2023
bytes032 marked the issue as low quality report |
bytes032 marked the issue as not a duplicate |
bytes032 marked the issue as primary issue |
c4-pre-sort
added
the
primary issue
Highest quality submission among a set of duplicates
label
Sep 11, 2023
This was referenced Sep 11, 2023
Closed
Closed
bytes032 marked the issue as duplicate of #1782 |
c4-pre-sort
added
duplicate-1782
and removed
primary issue
Highest quality submission among a set of duplicates
labels
Sep 11, 2023
bytes032 marked the issue as not a duplicate |
bytes032 marked the issue as duplicate of #1662 |
c4-judge
added
the
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
label
Oct 6, 2023
GalloDaSballo marked the issue as unsatisfactory: |
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-1662
low quality report
This report is of especially low 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/reLP/ReLPContract.sol#L115-L164
Vulnerability details
Impact
If oracle address will be changed, it will be impossible to update it for
ReLPContract
.Proof of Concept
See
ReLPContract
and functionsetAddresses
.as you can see, this function updates new addresses and set approves.
Now lets dive into
safeApprove
.This function can either set approve to 0 or change approve from 0 to any other value.
Now lets consider next case:
pair
,tokenA
andtokenB
pair
,tokenA
andtokenB
impossible.safeApprove
will fail because of(value == 0) || (token.allowance(address(this), spender) == 0)
ammRouter
to new one every time, or your transaction will fail.Tools Used
Manual review
Recommended Mitigation Steps
Either split parameter modification by different functions, or add possibility to set approval to 0.
Better separate
setAddresses
by multiple atomic setters like:Assessed type
ERC20
The text was updated successfully, but these errors were encountered: