-
Notifications
You must be signed in to change notification settings - Fork 982
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
Detectors related to improper usage of Oracle APIs #2283
Comments
Really great work @talfao! I think we're interested in upstreaming these. Would you make a PR and add the tests according to our guidelines (let me know if I can help or answer any questions) please? Then, I can do a more thorough review in the PR |
Hello @0xalpharush, Thanks for quick answer. That are great news. I will create PR soon. |
Hello @0xalpharush, The PR #2289 was created. I would be glad to receive any feedback on the detector. However, I still have some features in my backlog and will improve the overall detection soon. Talfao |
Hello @0xalpharush, I have already pushed improvements and fixed some issues after evaluation on several contracts. From my perspective, the PR is ready for review. I am looking forward to your feedback. Thank you. |
Describe the desired feature
Hello folks,
I am working on a bachelor's thesis related to smart contract security. My goal is to use static analysis to detect improper usage of Oracle APIs and, therefore, prevent possible vulnerabilities. I have created a few detectors in Slither, currently focusing on Chainlink data validation. I plan to support other Oracles and generalise the detectors, if possible.
The code is available here (it's a clone, not a fork of Slither at the moment):
repository
. To see what gets detected, you can check thetests
. For example when callingpriceFeed.latestRoundData()
, the return value price should be checked:Omitting such a check can lead to potentially serious issues if the oracles provide incorrect data. The
detector
checks whether the price-check is present.Would you be interested in such a type of detector in Slither? It does not detect Solidity/Vyper syntax-related bugs but could be a valuable detector anyway. Maybe running such a detector could be hidden behind a feature flag.
I am looking forward to hearing any feedback from you on both the code and the idea of such detectors. Also, I am more than happy to improve/refactor the code to fit Slither better.
Cheers, Talfao
The text was updated successfully, but these errors were encountered: