-
Notifications
You must be signed in to change notification settings - Fork 970
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
Arbitrary-send-eth false positive #1225
Comments
We can look into tightening the heuristics to ignore transfers to addresses where the amount sent is based on the address i.e. used as key in a mapping or argument of a function. I think the detector in the 0.8.3 is still named "arbitrary-send" and was renamed to "arbitrary-send-eth" on the development branch (#1025), so substituting in "arbitrary-send" should work. |
From my understanding, the detector already tries to exclude functions where the address is used as an index (eg slither/slither/detectors/functions/arbitrary_send_eth.py Lines 52 to 60 in e3dcf1e
However, this only checks for |
Describe the issue:
UPDATE:
(2) and (3) are resolved by using detector name "arbitrary-send", not "arbitrary-send-eth". That could be made more clear in the docs since it is titled "Check: arbitrary-send-eth" on the man page, but it has been resolved
However, (1) still seems to be an issue
OP:
arbitrary-send-eth seems broken- both producing false positive (1), and not working as a detector that can be ignored or detected against individually (2) and (3).
(1) This code appears controlled, not sending ether to an arbitrary user address. They have to have an allowanceAvailable per contract state, yet slither produces:
That's the first bug.
(2) Next, I added this line:
It still produces the high level warning
(3) Third, I ran
slither PowDAO.sol --detect arbitrary-send-eth
And I got the response
Code example to reproduce the issue:
Version:
0.8.3
Relevant log output:
PowDAO.getPayout(address) (PowDAO.sol#142-157) sends eth to arbitrary user Dangerous calls: - (success) = addressOfProposer.call{value: allowanceAvailable}() (PowDAO.sol#152) Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#functions-that-send-ether-to-arbitrary-destinations
and
slither PowDAO.sol --detect arbitrary-send-eth
The text was updated successfully, but these errors were encountered: