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

InfinityStaker and InfinityExchange are prone to "donate" user's ether by mistake #14

Closed
code423n4 opened this issue Jun 15, 2022 · 3 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 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-infinity/blob/601e0e5498587f5b1ae33f345223c86526ae9ce1/contracts/staking/InfinityStaker.sol#L345-L348
https://github.com/code-423n4/2022-06-infinity/blob/601e0e5498587f5b1ae33f345223c86526ae9ce1/contracts/core/InfinityExchange.sol#L1229

Vulnerability details

Impact

The methods receive and fallback are payable and the doesn't track the user ether, so the user's ether can be locked until owner decide.

The contracts contains a method to get the accidentally ether by the admin

/// @dev Admin function to rescue any ETH accidentally sent to the contract

But also, it facilitate the human errors with the payable methods receive and fallback.

Affected source code:

Recommended Mitigation Steps

  • Avoid accidentally sending ether by removing the receive and fallback method, otherwise the owner is in charge of MAYBE return the funds.
@code423n4 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 15, 2022
code423n4 added a commit that referenced this issue Jun 15, 2022
@nneverlander
Copy link
Collaborator

Duplicate

@0x1f8b
Copy link

0x1f8b commented Jun 26, 2022

Duplicate

@nneverlander could you add the issue number, it's easier for tracking

@nneverlander nneverlander reopened this Jul 5, 2022
@nneverlander nneverlander added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Jul 7, 2022
@HardlyDifficult
Copy link
Collaborator

I agree that this should be addressed. But this is just preventing user error and shouldn't come up during normal use. Plus the admin could refund them (once the withdraw bug is fixed of course). Lowering risk and merging with the warden's QA report #16

@HardlyDifficult HardlyDifficult 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 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Jul 11, 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 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

4 participants