-
Notifications
You must be signed in to change notification settings - Fork 736
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
TOB-WORM-4: Panicking on invalid inputs in Solana contracts #1532
Comments
Are there repro steps? Interested to take this on. |
Hi, for more details please see the audit report from ToB, item TOB-WORM-4 https://storage.googleapis.com/wormhole-audits/Wormhole_Audit_Report_TrailOfBits_2022-09.pdf |
When I'm building the solana package, I'm getting
Are there dummy address that I can use? |
I believe this can be closed now since #1672 has been merged |
I think some of the cases in the cosmwasm token bridge may have been missed due to changes that occurred after you started your PR. Leaving this open until someone confirms. Feel free to take a look as well @kii-dot 🙂 |
sounds good. I'll work on that. If there are more rust work do tag me :) @evan-gray |
Hey @kii-dot @evan-gray, For this issue to be considered fixed, the clippy lints should be enabled in CI. Anyone want to take a stab at that? |
Since I've been working on it, let me take it up. |
hey @tbjump @evan-gray Due to my schedule, I wont be able to attack this for the current time being. :( |
@aadam-10 is this open to take up? |
hi @ameya-deshmukh, please feel free to take a shot at this. |
hi @ameya-deshmukh, do you have any updates on this? |
Hey @aadam-10! Give me till the weekend to open a PR for this? |
hi @ameya-deshmukh, wondering if you'd had a chance to look into this. it's not urgent or anything, but someone else may want to pick it up. |
hi @aadam-10 yes. I'm actually working on a related project being built on Wormhole and this is actually one of the few issues which seemed relevant to be solved. I'll be opening a PR soon. Cheers |
Severity: Informational
Description
In several places within the solana smart contracts, the code panics when an arithmetic overflow/underflow occurs. Panics should be reserved for programer errors, e.g., assertion violations. Panicking on user errors dilutes panics’ utility.
Exploit Scenario
Alice, a Wormhole developer, observes a panic in the Wormhole codebase. Alice ignores the panic believing it is caused by user error, but it is actually caused by a bug she introduced.
Recommendations
Short term, reserve panics for programmer errors. Return Result::Err for user errors. Adopting such a policy will help to distinguish the two types of errors when they occur.
Long term, consider denying the following Clippy lints:
● clippy::expect_used
● clippy::unwrap_used
● clippy::panic
Doing so will not prevent all panics, but it will prevent many of them.
The text was updated successfully, but these errors were encountered: