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

Revisit arbitrary-send detector #443

Open
montyly opened this issue Apr 16, 2020 · 2 comments
Open

Revisit arbitrary-send detector #443

montyly opened this issue Apr 16, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@montyly
Copy link
Member

montyly commented Apr 16, 2020

I am not sure we should keep the arbitrary-send detector, from experience it does not give any meaningful results most of the time.

We need to find how to improve its heuristics or remove it

@montyly montyly added the enhancement New feature or request label Apr 16, 2020
@Otto-AA
Copy link

Otto-AA commented Dec 2, 2023

Hi, I'd be curious to hear in which cases this detector reports false positives. For a different use case*, I thought about implementing nearly the same logic. Hearing that it's already rather useless for the general case lowers my expectations on this other use case 🙃 .

We need to find how to improve its heuristics

For my use case I would have also tried to exclude functions, where the destination is used in conditions or require statements, because then it is a "checked" destination and not arbitrary anymore. Could this help to filter out the false positives you have encountered?

*My use case would be the niche of frontrunning for badly designed "Puzzles". For instance, if a contract directly sends you ether you for finding the preimage of a hash, then sending the solution as a transaction would be vulnerable to frontrunning (someone else could see the solution in the transaction pool and copy it to submit it faster). While experimenting with different tools, I've realized that the arbitrary-send detector is already able to detect this vulnerable behaviour.

@AlissonRS
Copy link

AlissonRS commented Jul 29, 2024

Some ideas to reduce false-positives:

  1. Ignore if the destination is address(this), e.g. transferFrom(user, address(this), amount). This would cover ERC3156.
  2. Ignore if msg.sender === address(this), would cover delegatecall used between facets as part of EIP-2535.
  3. Ignore if destination is an immutable state var (similar to arbitrary-send-eth: Don't report if destination is immutable state var #2488)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants