You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

# W3SA - Solana Insecure Programs

This benchmark is dedicated to Solana contracts that are intentionally vulnerable to a list of most common vulnerabilities specific to Solana. The goal is to assess how effectively AI models and static analysis tools can detect these engineered weaknesses in a controlled scenario. This benchmark comprises a curated set of Solana programs, each engineered with one or more of the above-listed vulnerabilities and are inspired by the sealevel-attacks that is a list of all the common vulnerabilities that are unique to the Solana Programming Model.

List of vulnerabilities

  1. Account Data Matching: Vulnerability due to mismatches or incorrect assumptions about account data formats. Mismatches between the expected and actual data structures of an account can lead to runtime errors to exploited assumptions. Attackers might use malformed sata to bypass logic cheks in the program.

  2. Arbitrary CPI: Allowing uncontrolled cross-program invocation (CPI) can enable a program to call external contracts with parameters it doesn't fully control. This opens the door for malicious code execution or unintended state changes.

  3. Duplicate Accounts: Passing the same account as an input could result in unintended data overwriting. This may lead to conflicts where invariants are violated.

  4. Improper Account Closing: Failing to securely close an account can leave sensitive state data or funds vulnerable after the account is no longer in active use. Improper closure may also allow unauthorized reactivation or access to stale data.

  5. Integer Overflow/ Underflow: Arithmetic operations that aren’t properly checked can wrap around, resulting in overflow or underflow errors. This can cause miscalculations in token balances or counters, compromising program logic.

  6. Missing Owner Check: Neglecting to verify that an account's owner is valid before performing operations can let attackers manipulate accounts they do not control. This weakens the security model by bypassing fundamental ownership restrictions.

  7. Missing Signer Check: Omitting verification that the transaction is signed by the required authority opens the door to unauthorized actions. Without this check, sensitive operations may be executed by any caller.

  8. PDA Sharing: Sharing Program Derived Addresses (PDAs) between different parts of a program without proper safeguards can expose sensitive state data. This may result in unintended interactions or security vulnerabilities when multiple programs access the same PDA.

Detection Rate

Models Overall Detection Rate
ALMX-1.5 87.5%
GPT-o1 75.0%
GPT-o3-mini 75.0%
GPT-o1-mini 62.5%
Claude-3.5 62.5%
GPT-4o 50%
Solana Insecure Programs The ALMX-1.5 model significantly outperforms the base AI models, achieving an overall detection rate of 87.5% compared to 50% and 62.5% for other base models. ALMX consistently identifies all targeted vulnerabilities except for “Duplicate Accounts” vulnerabilities, which have also not been detected by any other model. ALMX-1.5 is able to catch the “Improper Account Closing”, where all other base models had negative detections.

Repo Structure

├── README.md
├── programs
│   ├── vuln-1
│   │   ├── src/lib.rs
│   │   └── Cargo.toml
│   └── vuln-2
│       ├── src/lib.rs
│       └── Cargo.toml
├── bm_src
└── resources

Set up

  • Install uv package manager if not yet available
  • Run uv sync

Run an experiment

  • Set your OPENAI_API_KEY as environmental variable
  • Launch your experiment by running:
uv run experiment.py --model o3-mini

Contact Us

For or questions, suggestions, or to learn more about Almanax.ai, reach out to us at https://www.almanax.ai/contact

Downloads last month
15

Collection including almanax/insecure-solana-programs