-
Notifications
You must be signed in to change notification settings - Fork 0
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
QA Report #255
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
Jun 19, 2022
Duplicate of #154 |
jakekidd
added
duplicate
This issue or pull request already exists
and removed
duplicate
This issue or pull request already exists
labels
Jun 24, 2022
Closed as duplicate of #154 |
No mention of what impact this will have on the protocol's users and their respective funds. This isn't simply a revert issue, this legitimately breaks the flow of bridge transfers under certain token implementations. |
Downgrading to |
0xleastwood
added
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
and removed
duplicate
This issue or pull request already exists
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
labels
Aug 12, 2022
However, the warden submitted multiple QA reports. As such, this will not be judged. |
0xleastwood
added
invalid
This doesn't seem right
and removed
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
labels
Aug 12, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
safeApprove()
for may revertLines of code
https://github.com/code-423n4/2022-06-connext/blob/20f86d58444d7c8178735ada7e456a3112116e54/contracts/contracts/core/connext/libraries/AssetLogic.sol#L347
Vulnerability details
Impact
safeApprove function prevents changing an allowance between non-zero values to mitigate a possible front-running attack. It reverts if that is the case. Instead, the safeIncreaseAllowance and safeDecreaseAllowance functions should be used. Comment from the OZ library for this function: “// safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and ‘safeDecreaseAllowance'"
Proof of Concept
https://github.com/code-423n4/2022-06-connext/blob/20f86d58444d7c8178735ada7e456a3112116e54/contracts/contracts/core/connext/libraries/AssetLogic.sol#L347
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/6842518b1b71fac9a21c7d94ec521992cff266b5/contracts/token/ERC20/utils/SafeERC20.sol#L44-L57
Tools Used
Manual Analysis
Recommended Mitigation Steps
Use
safeIncreaseAllowance()
function instead ofsafeApprove()
.The text was updated successfully, but these errors were encountered: