Resources
Security guides and best practices
Signature Spoofing
Occurs when an attacker is able to bypass signature verification on an instruction, allowing unauthorized transactions.
// Vulnerable code pattern if (pubkey.equals(expectedSigner)) { // proceed with transaction }
Prevention:
Always verify signatures using Solana's native signature verification functions. Never rely on manual comparison without cryptographic verification.
Account Validation Failures
When a program doesn't properly validate the ownership or properties of accounts, allowing attackers to supply malicious accounts.
// Missing ownership check function process(account) { // directly use account data without ownership validation }
Prevention:
Always verify account ownership, check all account relationships, and validate account data before processing transactions.
Price Oracle Manipulation
Occurs when attackers manipulate price feeds used by lending protocols to create artificial price movements.
// Vulnerable approach function calculateLTV(asset, price) { // using price without validation or time-weighted checks return assetAmount * price; }
Prevention:
Use time-weighted average prices (TWAP), implement circuit breakers, and cross-check prices from multiple sources.