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

Unnecessary payable attribute may allow users to send/lock BNB accidentally #118

Closed
code423n4 opened this issue Jul 21, 2021 · 1 comment
Assignees
Labels
1 (Low Risk) bug Something isn't working duplicate This issue or pull request already exists

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

The payable attribute will allow swapTo() to receive BNB and may confuse/allow users into sending BNB to contract trying to swap that to token, which is not the case. This will lead to user's BNB getting locked in this contract without a way to retrieve it.

Proof of Concept

https://github.com/code-423n4/2021-07-spartan/blob/e2555aab44d9760fdd640df9095b7235b70f035e/contracts/Pool.sol#L210-L226

Tools Used

Manual Analysis

Recommended Mitigation Steps

Remove payable attribute as it is not required here.

@code423n4 code423n4 added 1 (Low Risk) bug Something isn't working labels Jul 21, 2021
code423n4 added a commit that referenced this issue Jul 21, 2021
@SamusElderg SamusElderg added the duplicate This issue or pull request already exists label Jul 26, 2021
@SamusElderg
Copy link
Collaborator

Duplicate of #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 (Low Risk) bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants