Menu

1 / 5

anchor-sec-lint: a heuristic security linter for Anchor programs

DEV Community: rust·Abdeldjalil Chougui·4 days ago
#DgU1jwXX
#devtorust#devto#dev#anchor#account
Long article (1231 words) — no AI summary yet.
Reading 0:00
15s threshold

Many of the bugs that hurt Solana programs are not clever. An authority account that was never required to sign. An UncheckedAccount that nobody checked. A PDA created with a bump taken from the caller. A vault that stores its owner, while the instruction never compares that owner with the signer. These are account-validation mistakes, and they are easy to make because Anchor lets you describe accounts in a few lines of attributes, where one missing word changes who is allowed to call the instruction.

Reviewers know this list by heart, but people get tired, and a pull request that adds one new #[derive(Accounts)] struct does not always get a full review.

anchor-sec-lint is a static checker for Anchor programs that looks for these patterns. It parses the Rust sources with syn , or reads an Anchor 0.30+ IDL, and flags the common mistakes.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.