Solana Smart Contract Audits: Benefits, Process and Checks
A Solana audit checks a program's account rules, signer checks and PDA logic before launch. Here are the benefits, the process and the checks that matter.
On this page
Short answer
A Solana smart contract audit is a security review of a program written in Rust or with the Anchor framework that checks every account the program touches, every signer rule and every cross-program call before launch. It finds missing signer and owner checks, unsafe PDA logic and other Solana-specific flaws, and it lowers the risk of a loss without proving the code safe.
What is a Solana smart contract audit?
A Solana smart contract audit is a security review of a program written in Rust or with the Anchor framework, carried out before the program handles real funds. The auditor reads the code, checks every account the program touches and tests whether an attacker can move funds or change state they should not control.
Solana programs are stateless: the code lives at one address and all state lives in separate accounts that callers pass in. That design makes audits different from Ethereum audits, because the program must verify each account itself. An audit checks those verifications one by one.
An audit lowers risk; it does not prove the code safe. The report ranks findings by severity, the team fixes them, and the auditor re-checks the fixes. A program that skips this step is trusting untested code with other people's money.
Why is a Solana audit different from an Ethereum audit?
The table below shows the key differences. On Ethereum, the sender is built into every call, and the contract holds its own state. On Solana, the caller chooses every account, and the program must check each one. That single difference creates most Solana-specific bugs.
| Feature | Solana | Ethereum |
|---|---|---|
| Where state lives | Separate accounts passed in by the caller | Inside the contract itself |
| Who the caller is | Explicit account slots in the instruction | Built in as the sender of the call |
| How authority is checked | Program must verify signer and owner | Sender is known to the contract |
| Main framework | Anchor, or native Rust | Solidity with Hardhat or Foundry |
| Main bug classes | Missing signer and owner checks, PDA errors | Reentrancy, access control, oracle errors |
| Upgrade model | Upgrade authority can replace the program | Proxy patterns or immutable deploys |
Anchor, the most used Solana framework, adds typed account checks that catch some errors automatically. But Anchor only enforces the constraints the developer declares. A missing signer declaration or a loose seed constraint is still a bug, and the audit has to find it. The guide to building on Solana shows how Anchor programs are normally structured.
What do auditors check first?
Auditors start with the checks that lose money fastest. The first is the signer check: any instruction that moves funds or changes authority must confirm the account signed the transaction. In Anchor this is the Signer type; in native Rust it is the is_signer flag.
The second is the owner check: an account the program treats as its own must be owned by the program, or an attacker can pass a fake account with the same data layout. The third is PDA logic: a program derived address must be re-derived from the expected seeds, or an attacker can pass an arbitrary account as a PDA.
Then come cross-program calls, reinitialization, account data matching, integer overflow and closing accounts. Each has a known failure pattern, and the audit walks every instruction against the same list, because one unchecked account is enough to lose funds.
How does an audit run, step by step?
A typical audit runs in six steps, and each step has a clear output. The team freezes the code first, because auditing a moving target wastes the review. Then the auditor reads the code and the tests, builds a threat model and works through the bug classes.
- Freeze the scope. Share the code, the docs and the tests, and agree which programs and instructions are in scope.
- Map instructions and accounts. List every instruction, the accounts it needs and the checks each one declares.
- Review every instruction by hand. Walk each one against the Solana bug list: signer, owner, PDA, cross-program calls, reinitialization and data matching.
- Run automated checks. Static analysis and fuzzing catch what manual review misses, but they do not replace it.
- Report findings by severity. Each finding states the risk, the location and a suggested fix.
- Fix and re-check. The team fixes the findings and the auditor confirms the fixes before the report is published.
The whole run takes days to weeks depending on size. A small token program may take a week; a lending protocol with several programs takes longer. Teams should plan the audit into the launch schedule, not bolt it on the day before. The steps to run a smart contract audit cover the same process in general terms.
What do the big Solana losses teach?
In February 2022, an attacker minted 120,000 wrapped ETH on Solana through the Wormhole bridge, a loss of about 325 million dollars. The cause was a sysvar validation gap: the contract accepted a fake account in place of a real system variable. The lesson is that every account, including system accounts, must be verified.
In March 2022, the Cashio stablecoin lost over 52 million dollars because the program checked one account but never validated the mint field inside it. The attacker built a chain of fake accounts, deposited worthless collateral and minted real tokens. The lesson is that owner checks are not enough when an account's fields point to other accounts.
Both losses came from missing checks, not from exotic cryptography. That is why Solana audits focus on account validation: the bugs that lose money are usually a check the developer forgot to write. The overview of smart contract security puts these cases in the wider picture.
How do you prepare a program for audit?
Preparation starts before the auditor arrives. Freeze the code, write down what each instruction should do, and make sure the tests pass. A clear spec lets the auditor check the program against what it should do, not just what it does.
Prepare a threat model: list who can call each instruction, what each account should be and what happens if an attacker controls one account. Include the deployment plan, the upgrade authority and the pause mechanism. Auditors ask for these because the answers shape the review.
Run your own checks first: static analysis, unit tests and invariant tests. Fix what you find before the audit starts, so the auditor's time goes to the bugs your tools cannot see. A team that arrives unprepared pays for the auditor to find basic issues. The guide to what a smart contract audit covers lists the documents to prepare.
Example (hypothetical): an audit catches a missing signer check
Example (hypothetical): a staking program holds 480,000 tokens in a vault for 1,200 stakers, an average of 400 tokens each. The withdraw instruction checks the staker's balance but never checks that the caller signed the transaction.
The auditor shows the flaw: anyone can pass another staker's account and withdraw their 400 tokens, because the program never asks who signed. The fix is one declaration: the authority account becomes a Signer, and the program rejects any call without the matching signature.
After the fix, the team tests with three accounts. The owner withdraws 400 tokens and the vault falls to 479,600. A second account tries to withdraw the owner's balance and the call fails, so the owner's balance stays at 400. The failed call is the proof the check works.
What are the common mistakes?
The most common Solana audit mistakes are auditing after launch, changing code during the audit, and treating the report as a pass mark instead of a fix list.
- Auditing after launch. An audit finds bugs; it cannot undo a loss. Audit before real funds arrive.
- Changing code mid-audit. The report covers the code the auditor read. New code needs a new review.
- Treating the report as a pass mark. A report with findings is normal. What matters is fixing them and getting the re-check.
- Skipping the re-check. Fixes can introduce new bugs. The auditor should confirm each fix, not just trust the team.
- Assuming Anchor removes the need for review. Anchor enforces only the constraints you declare. A missing declaration is still a bug.
- No pause or upgrade plan. A finding after launch needs a response. Decide before launch who can pause the program and how.
Key takeaways
- Solana programs hold no state, so every instruction must verify the accounts it is given
- Missing signer and owner checks and unsafe PDA logic are the most common Solana flaws
- Anchor enforces only the constraints the developer declares, so review is still needed
- A normal audit runs in six steps: freeze scope, map instructions, review, automate, report, re-check
- The Wormhole and Cashio losses both came from missing account checks, not exotic bugs
Frequently asked questions
How is a Solana audit different from an Ethereum audit?
The code differs because Solana programs are stateless and every account is passed in by the caller, so the program must verify each account. Ethereum contracts hold their own state and know the sender of each call. The audit process is the same, but the bug list is different.
What does a Solana auditor check first?
Signer checks, owner checks and PDA logic come first, because those flaws lose money fastest. Then the auditor checks cross-program calls, reinitialization, account data matching, integer overflow and how accounts are closed.
Do I still need an audit if I use Anchor?
Yes. Anchor adds typed account checks that catch some errors automatically, but it enforces only the constraints you declare. A missing signer declaration or a loose seed constraint is still a bug that only a review will find.
How long does a Solana audit take?
It depends on size. A small token program may take about a week, while a lending protocol with several programs can take several weeks. Teams should plan the audit into the launch schedule rather than adding it at the end.
What should I prepare before an audit?
Freeze the code, write a spec for each instruction, make sure the tests pass and prepare a threat model. Include the deployment plan, the upgrade authority and the pause mechanism, because auditors use those to shape the review.
Which Solana audit firms are well known?
Firms that specialise in Solana programs include OtterSec, Neodyme, Kudelski Security and Trail of Bits, among others. Teams should compare recent Solana audit reports and check that the firm has reviewed programs similar to theirs.