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

PromiseRouter is prone to lock user's ether by mistake #67

Closed
code423n4 opened this issue Jun 14, 2022 · 4 comments
Closed

PromiseRouter is prone to lock user's ether by mistake #67

code423n4 opened this issue Jun 14, 2022 · 4 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-06-connext/blob/20f86d58444d7c8178735ada7e456a3112116e54/contracts/contracts/core/promise/PromiseRouter.sol#L132

Vulnerability details

Impact

PromiseRouter is prone to lock user ether by mistake.

Proof of Concept

The only way for the PromiseRouter contract to send the ether is through the process method, only the bumpCallbackFee and initCallbackFee methods control that the deposit of the ether is registered in order to return it, so if a user sends ether to the contract using receive method, this ether cannot be returned to the user, and it will be locked forever.

Is not a good practice to have a receive method if is not used.

Affected source code:

Recommended Mitigation Steps

I recommend to remove the receive method.

@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Jun 14, 2022
code423n4 added a commit that referenced this issue Jun 14, 2022
@LayneHaber LayneHaber added sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) labels Jun 25, 2022
@LayneHaber
Copy link
Collaborator

disagree with severity, but acknowledge issue. this seems it should be a QA thing -- you will always lose money sending funds to the wrong address/in the wrong way onchain

@LayneHaber
Copy link
Collaborator

connext/monorepo@077803c

@LayneHaber LayneHaber added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label Jun 27, 2022
@0xleastwood
Copy link
Collaborator

Definitely a QA issue. Its on the user to not send funds directly to contracts.

@0xleastwood
Copy link
Collaborator

Merging with #71.

@0xleastwood 0xleastwood added duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 3 (High Risk) Assets can be stolen/lost/compromised directly disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) labels Aug 15, 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 duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

3 participants