Solana · Rust · Anchor

Solana Smart Contract Audit

Quick Answer

  • Solana programs are written in Rust and follow an account model fundamentally different from Solidity — programs receive accounts as inputs and must validate each one explicitly. Missing owner checks and signer verification are the most common exploited vulnerability classes.
  • SmartContractAuditor.ai analyzes Solana Rust programs for account owner validation, PDA seed correctness, signer requirements, sysvar substitution attacks, and Borsh deserialization safety.
  • Anchor framework reduces boilerplate but doesn't prevent all vulnerability classes. Most serious Solana exploits have involved missing custom validation beyond Anchor defaults. Free first scan, results in 60 seconds.

Solana's separation of program logic and account data is its most important architectural difference from EVM chains — and the source of its most common security failures. Every Solana program must validate every account it receives. The runtime enforces signatures; everything else is the program's responsibility.

What Makes Solana Program Security Different

Account Model

Programs and data are separate. Programs receive accounts as instruction inputs and must validate owner, signer, discriminator, and content for each. Nothing is validated automatically except signatures.

PDA Addresses

Program Derived Addresses are deterministic from seeds. Poorly designed seeds allow an attacker to predict or collide PDA addresses, substituting one account for another in privileged instructions.

Cross-Program Invocation

When a Solana program calls another via CPI, it can pass its authority accounts — but only those it legitimately has. CPI privilege escalation occurs when insufficient checks allow unintended account passing.

Borsh Serialization

Account data is serialized with Borsh. Field order matters. Incorrect deserialization schema silently reads garbage bytes as valid field values — type system doesn't protect from schema mismatches.

Audit Your Solana Program Now

Free scan · results in 60 seconds · Rust/Anchor vulnerability detection

Solana Program Vulnerability Classes

Vulnerability TypeSeverityDescriptionExample
Missing Account Owner Check
Critical
Solana programs receive accounts as instruction inputs. If a program doesn't verify that an account is owned by the expected program, an attacker can pass a malicious account with the correct shape but controlled data. Owner checks are not enforced by the runtime — the program must implement them.A token program that checks account discriminator (shape) but not owner — an attacker creates a look-alike account owned by their own program, passes it to a privileged instruction, and executes operations on their crafted data.
Missing Signer Verification
Critical
Solana instructions can list multiple accounts, some of which must be signers. If a program doesn't verify that a required account actually signed the transaction, an attacker can pass any account in that position and execute privileged operations without authorization.A governance instruction that accepts an 'authority' account but doesn't call require_signer(authority) — any account can be passed as the authority, bypassing the permission check.
PDA Seed Collision
High
Program Derived Addresses (PDAs) are deterministically derived from seeds and a program ID. If a program uses seeds that can be controlled or predicted by attackers, or if two different logical accounts can derive to the same PDA, an attacker can substitute one PDA for another in privileged instructions.A protocol that derives a user's escrow PDA using only the user's pubkey as a seed — an attacker who controls a second account with the same pubkey (impossible, but the seed collision arises from incomplete seed design) or can predict another user's PDA can substitute accounts.
Borsh Deserialization Confusion
High
Solana uses Borsh (Binary Object Representation Serializer for Hashing) for account data serialization. Incorrect Borsh field ordering or type mismatches silently deserialize corrupted data without panicking — the program reads garbage bytes as valid field values.A program that stores a u64 followed by a Pubkey in account data. An upgrade changes the order to Pubkey then u64 without migrating existing accounts — old data is deserialized with swapped field values, reading the high bytes of the old u64 as the first bytes of a pubkey.
Sysvar Account Substitution
Medium
Solana sysvars (Clock, Rent, SlotHashes, etc.) are special accounts providing runtime state. Programs that read sysvars without verifying the account is the canonical sysvar can be passed fake sysvar accounts with attacker-controlled values for timestamps, slot hashes, or rent.A time-locked protocol that reads the current timestamp from an account passed as Clock sysvar but doesn't verify the account address — an attacker passes a crafted account with a far-future timestamp, unlocking funds before the lock period expires.

Solana Program Audit — Frequently Asked Questions

What language are Solana programs written in, and does SmartContractAuditor.ai support it?
Solana programs (smart contracts) are primarily written in Rust, though C is also supported. Most production Solana programs use the Anchor framework, which provides macros and type derivations that handle some security checks automatically — but Anchor doesn't prevent all vulnerability classes. SmartContractAuditor.ai analyzes Solana/Rust programs for account validation failures, PDA seed correctness, signer verification, sysvar substitution, and Borsh deserialization issues.
How is Solana smart contract security different from Solidity/EVM security?
The most fundamental difference is Solana's account model. In Solidity, data and code are bundled in a contract. In Solana, programs (code) and accounts (data) are entirely separate — programs receive accounts as instruction inputs and must validate every account they receive. Missing owner checks and signer verification are uniquely Solana failure modes. Solidity's reentrancy has no direct equivalent in Solana; instead, cross-program invocation (CPI) security and privilege escalation through account reuse are the comparable concern.
Does using Anchor framework protect against Solana vulnerabilities?
Anchor significantly reduces the attack surface by auto-generating account constraints — the `#[account(...)]` macro handles discriminator checks, owner verification, and some signer requirements automatically. But Anchor doesn't prevent all vulnerability classes. PDA seed design, cross-program invocation privilege escalation, sysvar substitution, and Borsh deserialization correctness still require careful manual review. Most high-severity Solana exploits in the past three years have involved Anchor programs with missing custom validation beyond what the framework provides.
What are the most commonly exploited Solana vulnerabilities in production?
Missing account owner checks and missing signer verification are historically the most exploited — they're the Solana-specific equivalents of missing access control in Solidity. PDA seed collisions (where two different logical accounts can derive to the same address) are less common but highly exploitable when they occur. Sysvar substitution — passing fake Clock or SlotHashes accounts to manipulate time-locked protocols — has been used in several governance exploits.
How much does a Solana smart contract audit cost?
Traditional Solana Rust audits from specialized firms (OtterSec, Sec3, Neodyme, Trail of Bits) run $20,000–$150,000 for complex programs and take 4–10 weeks. OtterSec has published some of the most detailed Solana vulnerability research. AI-powered analysis at SmartContractAuditor.ai delivers Rust/Solana vulnerability detection in under 60 seconds, free for the first scan, with paid plans from $100/month for teams running frequent iterations.
Written by Duron Epps, Founder of SmartContractAuditor.ai · Last updated July 2026