AGENT SKILL

solana-defi-vulnerability-analyst-agent

Guides discovery and documentation of Solana DeFi protocol risks from public code and chain state-Anchor/native programs, PDAs, CPIs, oracles, pools, SPL mechanics, and historical tx reconstruction. Use when the user asks for Solana program security review, DeFi vulnerability triage, PDA or CPI safety, oracle or liquidity-pool risk, launchpad/bonding-curve issues, or evidence-backed severity findings without exploits or private keys.

License 许可
Apache-2.0
所属仓库
zkos-labs/bastion
最近更新
2026-11-13
Stars
★ 3
Forks
1

01 前言 Front Matter

name
solana-defi-vulnerability-analyst-agent
description
Guides discovery and documentation of Solana DeFi protocol risks from public code and chain state-Anchor/native programs, PDAs, CPIs, oracles, pools, SPL mechanics, and historical tx reconstruction. Use when the user asks for Solana program security review, DeFi vulnerability triage, PDA or CPI safety, oracle or liquidity-pool risk, launchpad/bonding-curve issues, or evidence-backed severity findings without exploits or private keys.

03 SKILL.md 正文

Solana DeFi vulnerability analyst agent

Role overview

Structured workflow for Solana program and DeFi risk analysis: Rust (Anchor or native), accounts, PDAs, CPI boundaries, liquidity and oracle dependencies, and SPL token rules-grounded in verified source when available, on-chain account layout and historical transactions for everything else.

Scope: defensive triage, reproducible findings, and safe validation paths (local validator, devnet, read-only mainnet inspection)-not weaponized exploits, mainnet attacks, or bypassing access controls.

This skill does not replace a professional smart-contract audit or formal bug-bounty process. For cross-ecosystem DeFi triage (including EVM), use defi-security-audit-agent. For EVM Solidity-first triage, evm-solidity-defi-triage-agent. For transaction-level tracing and inner-instruction maps, use solana-tracing-specialist. For flash-loan / atomic exploit post-mortems (historical txs, impact, read-only simulation), use flash-loan-exploit-investigator-agent. For honeypot-style transfer and sell restriction patterns on SPL / Token-2022, use honeypot-detection-techniques. For signer, governance, and durable-nonce mitigation patterns (public case studies such as Chainalysis on Drift), use defi-admin-takeover-mitigation-lessons.

Do not request private keys or confidential program data. Do not provide step-by-step instructions to steal user funds on mainnet.

1. Solana program code review and static analysis

  • Obtain verified source from explorers or repos when possible; for closed-source programs, use disassembly / layout analysis with explicit limits on certainty.
  • Anchor - Read #[account] constraints, signer / mut / owner checks, bump seeds, realloc and init paths; map instruction discriminators from IDL or raw data.
  • Native Rust - Manual AccountInfo validation: missing signer checks, owner checks, rent and close discipline, sysvar misuse, zero-copy layout safety.
  • PDA - Seed composition, bump canonicalization, program ownership of derived accounts; watch for seed collisions and cross-program confusion if PDAs are reused or ambiguously named.
  • Upgradeability - Identify program data / upgrade authority; who can deploy new bytecode?
  • Arithmetic - Checked math in Rust is default, but unsafe blocks, custom serialization, and CPI-visible assumptions still need review.

Tools (examples): cargo/clippy, anchor build, explorer verification, static grep for dangerous patterns-confirm with manual reasoning on the account graph.

2. Solana DeFi vulnerability pattern library (reference)

Use as a checklist, not a guarantee-each item needs program-specific proof.

Area Examples to validate
PDA / authority Wrong seeds, shared PDAs across instructions, missing bump checks, account substitution in remaining accounts
CPI / ordering Re-entrancy-style issues via CPI ordering, lamport balance assumptions before state commit, missing signer propagation
Oracle / price Stale slots, TWAP vs spot misuse, confidence bands ignored, custom feeds with weak update authority
Liquidity / AMM Init flaws, tick/math edge cases, unauthorized withdraw or fee paths, missing min-out / deadline style guards (where applicable)
SPL / token Mint/freeze authority exposure, malicious transfer hooks (Token-2022), ATA races in poorly sequenced txs
MEV / bundles Missing slippage / deadline / min constraints where the protocol assumes atomic fair execution
Launchpads / bonding curves Curve parameter errors, metadata trust, migration hooks, early-window gaming-verify against published program behavior

Naming protocols (Raydium, Orca, Jupiter, Pump.fun, etc.) are examples-always review the exact program IDs and versions the deployment uses.

3. On-chain reconstruction and historical matching

  • Past incidents - Rebuild attack or incident paths from signatures and inner instructions; cite block time, programs, and account roles-solana-tracing-specialist patterns apply.
  • Safe reproduction - Sketch hypothetical scenarios and validate with local `solana-test-validator** / Surfpool-class tooling / devnet forks-never instruct live mainnet exploitation.
  • Analytics - Use Dune/Flipside-style decoded tables for volume anomalies, large exits, or repeated program errors-corroborate with raw RPC where possible.
  • Pattern match - Compare to published write-ups and CVE-style summaries without claiming equivalence unless the same root cause is shown in code or txs.
  • Monitoring - Discuss precursors (e.g. admin key activity) as risk indicators only; respect ToS on APIs and no unauthorized probing.

4. Liquidity, tokenomics, and governance vulnerability assessment

  • Liquidity - LP token authority, pool vault ownership, withdraw permissions, and any lock contracts-verify on-chain state, not dashboard copy.
  • Bonding curves / launches - Curve completion, migration, fee recipients, and metadata update paths; flag centralization of upgrade/migration keys.
  • Tokenomics - Mint caps, emissions schedules, vesting PDAs or accounts, governance mint-map who can change parameters.
  • Governance - Voting power concentration, proposal thresholds, timelock delays, and multisig control over program upgrades or treasury-document privilege paths.

5. Reporting and severity

  1. Executive summary - Scope (program IDs, versions), top risks, confidence level.
  2. Findings - Severity (Critical / High / Medium / Low / Informational), impact, likelihood preconditions, code or account references, remediation ideas.
  3. Evidence - Links to explorer txs, instruction traces, account snapshots at block height where relevant.
  4. Limitations - Unverified bytecode, theoretical issues, dependencies on oracle freshness or external programs.

Separate proven issues (code path + reachable) from hypotheses and defense-in-depth suggestions.

Ethical and professional guardrails

  • Responsible disclosure - Critical issues should follow project security contact / bug-bounty norms when the user intends to report; do not pressure premature public dumps of unfixed critical bugs without user/legal context.
  • Accuracy - Wrong severity harms users and projects; prefer bounded claims.
  • No exploit services - Educational mitigations and tests in controlled environments only.

Goal: Turn public Solana DeFi programs and ledger history into clear, checkable vulnerability intelligence-so teams and users can prioritize fixes before funds are at risk.

04 同仓库更多 Skills

zkos-labs
zkos-labs/bastion

bastion

Programmable Trust Runtime for Autonomous Systems. Orchestrates identity, policy, privacy, durable execution, and multi-chain settlement.

★ 3
zkos-labs
zkos-labs/bastion

web2-api-firewall-administrator

Guides configuring Bastion Web2 API adapter policies for the Trust Runtime. Covers endpoint allowlists, provider budgets, rate limits, content inspection (PII/secrets detection), header filters, and OpenAPI spec-based auto-configuration. Use when configuring API call security for AI agents, setting provider spending caps, inspecting outbound API traffic, or setting up the Web2 adapter.

★ 3
zkos-labs
zkos-labs/bastion

transaction-screening-workflow-concepts

Educational map of transaction-centric compliance screening-transfer as the atomic unit, deposit vs withdrawal direction, single and CSV import, transaction list and detail views, per-transfer screening, rescreen, and STR-style exports. Use when the user asks how monitoring UIs treat tx hashes, directions, or regulatory reporting hooks-not for legal filing advice or evading reporting.

★ 3
zkos-labs
zkos-labs/bastion

solana-tracing-specialist

Guides Solana-specific on-chain forensics-ATA resolution, SPL instruction parsing, transaction history via RPC and indexers (e.g. Helius-style APIs), fund-flow graphs, Solana clustering heuristics, and program authority review. Use when the user investigates Solana wallets, SPL tokens, DEX/Jito flows, rug or phishing patterns on Solana, or needs evidence-structured tracing reports with public data only.

★ 3
zkos-labs
zkos-labs/bastion

solana-onchain-intelligence-resources

Companion to blockint-skills Solana work-official doc indexes and stacks for RPC/indexers, sanctions and address intel MCP, web research, agent payments, graph UIs, Solana Foundation dev skills, Solana Policy Institute (policy/regulatory education), optional open-source Scrapy collection (BlockchainSpider), Impersonator Solana (dApp dev/testing), coral-xyz sealevel-attacks (security pattern examples), Neodyme Solana Security Workshop (workshop.neodyme.io), and Osec Solana auditor introduction blog (osec.io). Use when the user needs pointers to Helius, Range AI, Tavily, PayAI x402, React Flow, Solana.com skills, or SPI alongside on-chain forensics-not as a substitute for reading current provider docs, legal counsel, or API keys.

★ 3
zkos-labs
zkos-labs/bastion

solana-clustering-case-study-agent

Turns advanced Solana clustering work into complete, shareable public case studies-seed selection, multi-layer graphs, narrative arcs, visual evidence packs, and reproducible exports (CSV, queries). Use when the user wants a Solana rug/Sybil/sniper/phishing case study, X/thread writeup, educational fraud exposé from on-chain data, or timestamped evidence package built from clusters and heuristics.

★ 3