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

Trapped ETH inside LooksRareAggregator cannot be rescued by owner and may be stolen by attacker #87

Closed
code423n4 opened this issue Nov 11, 2022 · 3 comments
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 downgraded by judge Judge downgraded the risk level of this issue duplicate-277 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-11-looksrare/blob/main/contracts/LooksRareAggregator.sol#L109
https://github.com/code-423n4/2022-11-looksrare/blob/main/contracts/LooksRareAggregator.sol#L220

Vulnerability details

Impact

Trapped ETH inside LooksRareAggregator cannot be rescued by owner, as the contract only implements rescueERC721 and rescueERC1155, but not an equivalent rescueETH.

As a result, an attacker can steal any trapped ETH simply by calling execute on any order and receive the total balance of the contract via the _returnETHIfAny function at the end of the execute method from LooksRareAggregator.

Proof of Concept

  1. Alice mistakenly sends ETH to LooksRareAggregator
  2. The contract owner cannot rescue Alice's ETH
  3. Bob creates an order costing only 1 wei and allowlists his other wallet
  4. Bob calls execute and successfully fills the order. The contract's balance (consisting of Alice's ETH) will be transferred to Bob

Tools Used

Foundry

Recommended Mitigation Steps

  • Implement rescueETH following the other methods rescueERC721 and rescueERC1155.
  • Remove the receive function from the contract
@code423n4 code423n4 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Nov 11, 2022
code423n4 added a commit that referenced this issue Nov 11, 2022
@c4-judge
Copy link
Contributor

Picodes marked the issue as duplicate of #277

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Dec 16, 2022
@c4-judge
Copy link
Contributor

Picodes marked the issue as satisfactory

@c4-judge
Copy link
Contributor

Picodes changed the severity to 2 (Med Risk)

@c4-judge c4-judge added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value downgraded by judge Judge downgraded the risk level of this issue and removed 3 (High Risk) Assets can be stolen/lost/compromised directly labels Dec 16, 2022
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 downgraded by judge Judge downgraded the risk level of this issue duplicate-277 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants