0xMacro/awesome-solana-security
GitHub: 0xMacro/awesome-solana-security
Stars: 572 | Forks: 61
# Awesome Solana 安全
帮助您构建更好、更安全的 Solana 程序的资源。持续更新中。
### 官方资源
- [Solana 文档](https://solana.com/docs/)
- [Solana 课程](https://solana.com/developers/courses/)
- [Solana 秘籍](https://solana.com/developers/cookbook)
- [支持多框架的 Solana 示例](https://github.com/solana-developers/program-examples)
- [Solana 训练营 2024](https://github.com/solana-developers/developer-bootcamp-2024)
- [SPL (Solana Program Library) 文档](https://spl.solana.com/):SPL 是官方的程序集合,旨在帮助您构建自己的 Solana 程序。
### Rust
如果您需要 Rust 入门知识,这些资源适合您:
- [Rust book](https://doc.rust-lang.org/book/)
- [Rust by example](https://doc.rust-lang.org/rust-by-example/index.html)
- [Rust cheatsheet](https://cheats.rs/)
### 使用原生 Rust 的 Solana 资源
- [Solana 原生 Rust 文档](https://solana.com/docs/programs/rust)
- [Solana 原生 Rust 课程](https://solana.com/developers/courses/native-onchain-development)
### 使用 Anchor 框架的 Solana 资源
我们强烈推荐使用 [Anchor](https://www.anchor-lang.com),这是一个用于构建安全 Solana 程序的框架。
- [Anchor 文档](https://www.anchor-lang.com/docs)
- [Anchor book](https://book.anchor-lang.com/)
- [Anchor by example](https://examples.anchor-lang.com/)
- [Anchor wiki](https://docs.rs/anchor-lang)
- [Anchor SPL wiki](https://docs.rs/anchor-spl)
### 面向 EVM 开发者转型的 Solana 资源
- [RareSkills 的面向 Ethereum 开发者的 Solana 课程](https://www.rareskills.io/solana-tutorial)
- [0xkowloon 的面向 EVM 开发者的 Anchor 教程](https://0xkowloon.gitbook.io/anchor-for-evm-developers)
- [S3v3ru5 的 Solana 初学者笔记](https://s3v3ru5.github.io/posts/solana-beginner-notes/)
### 通用资源
- [Ackee 的 Solana 手册](https://ackee.xyz/solana/book/latest/)
- [Blueshift 的 Anchor 和 Pinocchio 课程与挑战](https://learn.blueshift.gg/)
- [Rektoff 的 Security 路线图](https://github.com/Rektoff/Security-Roadmap-for-Solana-applications)
- [Helius 的博客](https://www.helius.dev/blog):经常发布 Solana 相关内容
- [Pine Analytics 的 Substack](https://substack.com/@pineanalytics1):专注于深入剖析 Solana 协议的特性
- [Infect3d 的 Solana 审计入门必读](https://www.infect3d.xyz/blog/solana-quick-start)
- [Lucrative_Panda 涵盖 Solana 所有安全事件的详尽研究文章](https://medium.com/@lucrativepanda/a-comprehensive-analysis-of-solanas-security-history-all-incidents-impacts-and-evolution-up-to-1b1564c7ddfe)
- [r0bre 的 100 个每日 Solana 技巧](https://accretionxyz.substack.com/p/r0bres-100-daily-solana-tips)
- [Accretion 的隐藏 IDL 指令及其利用方式](https://accretionxyz.substack.com/p/hidden-idl-instructions-and-how-to)
- [Farouk ELALEM 关于 Solana 程序底层工作原理的解释](https://ubermensch.blog/under-the-hood-of-solana-program-execution-from-rust-code-to-sbf-bytecode)
- [Ottersec 的 lamport 转账漏洞分析](https://osec.io/blog/2025-05-14-king-of-the-sol)
- [Asymmetric Research 关于 CPI 漏洞的分析](https://blog.asymmetric.re/invocation-security-navigating-vulnerabilities-in-solana-cpis/)
- [Alex Lazar 关于 CPI 漏洞的分析](https://newsletter.alexlazar.dev/p/external-calls-are-dangerous)
- [AlexAlekhinEth 对 Solana 网络架构的高层解释](https://medium.com/@AlexAlekhinEth/solana-how-it-works-a-technical-deep-dive-b180468abc3d)
- [Helius 关于 Solana 宕机事件的完整历史记录](https://www.helius.dev/blog/solana-outages-complete-history)
- [Exo Tech 面向开发者的创建对审计友好的架构文档指南](https://exotechnologies.xyz/p/a-developer-s-guide-to-audit-readiness)
- Solana 通用的常见漏洞:
- [Solana 安全课程](https://solana.com/developers/courses/program-security)
- [Urataps 带有漏洞的程序示例](https://github.com/urataps/solana-audit-examples)
- [Helius 的常见漏洞](https://www.helius.dev/blog/a-hitchhikers-guide-to-solana-program-security)
- [ImmuneBytes 的常见 Solana 攻击向量](https://github.com/ImmuneBytes-Security-Audit/Blockchain-Attack-Vectors/tree/main/Solana%20Attack%20Vectors)
- [Slowmist 的 Solana 最佳实践](https://github.com/slowmist/solana-smart-contract-security-best-practices)
- [Exvul 的 Solana 安全指南](https://exvul.com/rust-smart-contract-security-guide-in-solana/)
- [Zigtur 的 Solana 安全演练](https://www.youtube.com/watch?v=xd6qfY-GDYY)
- [M4rio 的 Solana 安全演练](https://www.youtube.com/watch?v=q4z8tIi43lg)
- [Nirlin 的高级 Solana 漏洞分析](https://substack.com/inbox/post/164534668)
- Token-2022 安全资源:
- Offside 的 Token-2022 最佳实践 [第一部分](https://blog.offside.io/p/token-2022-security-best-practices-part-1) 和 [第二部分](https://blog.offside.io/p/token-2022-security-best-practices-part-2)
- [Neodyme 的 Token-2022 安全分析](https://neodyme.io/en/blog/token-2022)
### 值得研究的代码库
**核心:**
- [Anchor 框架](https://github.com/solana-foundation/anchor)
- [Solana 系统程序](https://github.com/solana-program/system)
- [Solana 代币程序](https://github.com/solana-program/token)
- [Solana token-2022 程序](https://github.com/solana-program/token-2022)
- [Solana ATA (关联代币账户) 程序](https://github.com/solana-program/associated-token-account)
- [Solana 代币元数据程序](https://github.com/solana-program/token-metadata)
- [Metaplex 的代币元数据程序](https://github.com/metaplex-foundation/mpl-token-metadata)
**可选:**
- [Raydium 程序](https://github.com/raydium-io/raydium-cp-swap):AMM 协议
- [Kamino 程序](https://github.com/Kamino-Finance/klend):借贷协议
- [Squads 程序](https://github.com/Squads-Protocol/v4):多签协议
- [Solana 可升级 BPF 加载器程序](https://github.com/solana-program/loader-v3)
- [Solana 地址查找表程序](https://github.com/solana-program/address-lookup-table)
### 提问交流的地方
- [Solana Stack Exchange](https://solana.stackexchange.com/)
### 工具
- [Solana playground](https://beta.solpg.io/)
- [Rust playground](https://play.rust-lang.org/)
- [Sec3 的 IDL 猜测器](https://github.com/sec3-service/IDLGuesser):从链上程序逆向工程 IDL,以便于集成
- [Trail of Bits 的 Anchor X-ray](https://github.com/crytic/anchorx-ray):可视化 Anchor 程序中的账户
- [John Saigle 的 Anchor 版本检测器](https://github.com/johnsaigle/anchor-version-detector):帮助确定特定 Anchor 项目兼容的 Rust、Solana 和 Anchor 版本。
- [Ackee 的 Trident](https://ackee.xyz/trident/docs/latest/):Solana 模糊测试 (Fuzzing) 框架
- [Ackee 的 Solana IDE 扩展](https://marketplace.visualstudio.com/items?itemName=AckeeBlockchain.solana):自动检测 Solana 程序中的常见安全问题,并可视化 Trident 模糊测试覆盖率
### CTF
- [Ackee Solana CTF](https://github.com/Ackee-Blockchain/Solana-Auditors-Bootcamp/tree/master/Capture-the-Flag)
### 审计竞赛
公开可用的 Solana 安全审计:
- [Sherlock 上的 Orderly](https://audits.sherlock.xyz/contests/524/report):2 个高危和 1 个中危
- [Sherlock 上的 WOOFi](https://audits.sherlock.xyz/contests/535/report):2 个高危和 3 个中危
- [Code4rena 上的 Pump Science](https://code4rena.com/reports/2025-01-pump-science):2 个高危和 3 个中危
- [Code4rena 上的 Token22 Confidential Transfer](https://code4rena.com/reports/2025-08-solana-foundation):7 个低危
- [Code4rena 上的 Meteora](https://code4rena.com/reports/2025-08-meteora-dynamic-bonding-curve):2 个中危
**注意:如果您没有阅读权限,请在 Cantina Discord 服务器中联系 `0xmorph` 获取权限。**
- [Cantina 上的 Grass](https://cantina.xyz/competitions/3211ee0d-133f-43a0-837e-8dc1ecfaa424):13 个高危和 6 个中危
- [Cantina 上的 Olas](https://cantina.xyz/competitions/829164bf-7fba-4b84-a6b8-76652205bd97):2 个高危和 3 个中危
- [Cantina 上的 Tensor](https://cantina.xyz/competitions/21787352-de2c-4a77-af09-cc0a250d1f04):5 个高危和 10 个中危
- [Cantina 上的 ZetaChain](https://cantina.xyz/competitions/80a33cf0-ad69-4163-a269-d27756aacb5e):6 个高危和 27 个中危(部分 Solana 范围)
- [Cantina 上的 Inclusive Finance](https://cantina.xyz/competitions/3eff5a8f-b73a-4cfe-8c54-546b475548f0):45 个高危和 25 个中危(部分 Solana 范围)
- [Cantina 上的 Reserve Index](https://cantina.xyz/code/8b94becd-54e7-41cd-88e6-caae7becc76a):10 个高危和 11 个中危
- [Cantina 上的 Solayer](https://cantina.xyz/code/0f543452-2076-438f-86ae-bbd6b065fffb):3 个高危和 6 个中危
- [Cantina 上的 Genius](https://cantina.xyz/code/12acc80c-4e4c-4081-a0a3-faa92150651a):6 个高危和 4 个中危(部分 Solana 范围)
**注意:First Flights 是入门级的审计挑战,代码库较小,旨在帮助初学者练习查找漏洞。**
- [RustFund first flight](https://codehawks.cyfrin.io/c/2025-03-rustfund/results?t=report):4 个高危和 3 个中危
- [SSSwap first flight](https://codehawks.cyfrin.io/c/2025-05-ssswap/results?t=report):5 个高危和 4 个中危
标签:Anchor框架, DApp开发, Rust, Solana, SPL, Web3安全, 公链安全, 加密货币, 区块链安全, 去中心化应用, 可视化界面, 开发者文档, 智能合约审计, 编程教程, 网络流量审计