algorand-vulnerability-scanner
できること
Algorandのスマートコントラクトを、リレーキー攻撃、必要なフィールドの確認漏れ、アクセス制御の問題など、既知のセキュリティ上の弱点について検査します。Algorandプロジェクトを書いたりレビューしたりする監査人と開発者向けです。
使う場面
- ✓開発者が、TEALまたはPyTealで書かれたAlgorandプロジェクトをレビューしているとき。
- ✓監査人が、Algorandアプリの監査前のセキュリティチェックを望んでいるとき。
- ✓チームが、報告されたAlgorandの脆弱性の修正を確認したいとき。
スキルのリンク
https://github.com/trailofbits/skills/blob/main/plugins/building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“監査人に送る前に、私のAlgorand PyTealコントラクトに一般的なセキュリティ問題がないか検査してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、Algorandのトランザクションモデルに特有の11の既知のパターンを探し、一致した箇所を説明とともに報告します。静的解析ツールのTealerを実行することもできます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Algorand Vulnerability Scanner
1. Purpose
Systematically scan Algorand smart contracts (TEAL and PyTeal) for platform-specific security vulnerabilities documented in Trail of Bits' "Not So Smart Contracts" database. This skill encodes 11 critical vulnerability patterns unique to Algorand's transaction model.
2. When to Use This Skill
- Auditing Algorand smart contracts (stateful applications or smart signatures)
- Reviewing TEAL assembly or PyTeal code
- Pre-audit security assessment of Algorand projects
- Validating fixes for reported Algorand vulnerabilities
- Training team on Algorand-specific security patterns
3. Platform Detection
File Extensions & Indicators
- TEAL files:
.teal - PyTeal files:
.pywith PyTeal imports
Language/Framework Markers
# PyTeal indicators
from pyteal import *
from algosdk import *
# Common patterns
Txn, Gtxn, Global, InnerTxnBuilder
OnComplete, ApplicationCall, TxnType
@router.method, @Subroutine
Project Structure
approval_program.py/clear_program.pycontract.teal/signature.teal- References to Algorand SDK or Beaker framework
Tool Support
- Tealer: Trail of Bits static analyzer for Algorand
- Installation:
uv tool install tealer(ensure uv's tool bin dir is on PATH) - Usage:
tealer contract.teal --detect all
4. How This Skill Works
When invoked, I will:
- Search your codebase for TEAL/PyTeal files
- Analyze each file for the 11 vulnerability patterns
- Report findings with file references and severity, above them a coverage table carrying a verdict for every pattern
- Provide fixes for each identified issue
- Run Tealer (if installed) for automated detection
5. Example Output
When vulnerabilities are found, you'll get a report like this:
=== ALGORAND VULNERABILITY SCAN RESULTS ===
Project: my-algorand-dapp
Files Scanned: 3 (.teal, .py)
Vulnerabilities Found: 2
Coverage: 11/11 patterns reported
1 Rekeying Attack ................... found approval.py:45
2 Unchecked Transaction Fee ......... n/a stateful app, fees paid by sender
3 Closing Account ................... clear Assert(Txn.close_remainder_to() == Global.zero_address())
... one row per pattern, all 11 present ...
---
[CRITICAL] Rekeying Attack
File: contracts/approval.py:45
Pattern: Missing RekeyTo validation
Code:
If(Txn.type_enum() == TxnType.Payment,
Seq([
# Missing: Assert(Txn.rekey_to() == Global.zero_address())
App.globalPut(Bytes("balance"), balance + Txn.amount()),
Approve()
])
)
Issue: The contract doesn't validate the RekeyTo field, allowing attackers
to change account authorization and bypass restrictions.
6. Vulnerability Patterns (11 Patterns)
I check for 11 critical vulnerability patterns unique to Algorand. For detailed detection patterns, code examples, mitigations, and testing strategies, see VULNERABILITY_PATTERNS.md.
Pattern Summary:
- Rekeying Attack ⚠️ CRITICAL - Unchecked RekeyTo field
- Unchecked Transaction Fee ⚠️ HIGH - Fee not validated in smart signatures
- Closing Account (CloseRemainderTo) ⚠️ CRITICAL - Unchecked CloseRemainderTo drains the account
- Closing Asset (AssetCloseTo) ⚠️ CRITICAL - Unchecked AssetCloseTo drains the asset holding
- Group Size Check ⚠️ HIGH - No
Global.group_size()validation on atomic groups - Time-Based Replay Attack ⚠️ MEDIUM - No lease or round-range bound
- Access Controls ⚠️ CRITICAL - Update/delete and privileged calls unprotected
- Asset ID Verification ⚠️ HIGH - Asset ID not validated in asset operations
- Denial of Service (Asset Opt-In) ⚠️ MEDIUM - Push transfers strand on un-opted accounts
- Inner Transaction Fee ⚠️ MEDIUM - Inner fee not explicitly set to 0
- Clear State Transaction ⚠️ HIGH - Clear state program cannot reject, state left inconsistent
For complete vulnerability patterns with code examples, see VULNERABILITY_PATTERNS.md.
7. Scanning Workflow
Step 1: Platform Identification
- Confirm file extensions (
.teal,.py) - Identify framework (PyTeal, Beaker, pure TEAL)
- Determine contract type (stateful application vs smart signature)
- Locate approval and clear state programs
Step 2: Static Analysis with Tealer
# Run Tealer on contract
tealer contract.teal --d
よくある質問
どのコードを読みますか?
TEALのアセンブリファイルとPyTealのPythonコードを読みます。
専門の監査の代わりになりますか?
このスキルは監査前のチェックとして位置づけられているため、完全なレビューではなく、役立つ最初の確認です。
Tealerとは何ですか?
Trail of Bitsによる静的解析ツールで、このスキルはAlgorandのコントラクトに対して実行できます。
詳細
作者による元の説明
Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL/PyTeal).
repo: trailofbits/skills
人気
- GitHubのスター
- 8.0k
- ランキング
- #12656
- ライセンス
- CC-BY-SA-4.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
audit-context-building
8.0kエージェントが、セキュリティ監査の前に、見慣れないコードベースを学べるよう支援します。各関数が何を前提とし、何を保証し、何に依存しているかを整理します。
audit-prep-assistant
8.0kエージェントが、外部のセキュリティレビューに向けてコードベースを準備できるよう支援します。静的解析、テストカバレッジ、不要コードの整理、分かりやすい文書化を含みます。
cairo-vulnerability-scanner
8.0kエージェントが、StarkNet上のCairoのスマートコントラクトを、算術オーバーフロー、危険なレイヤー間メッセージ、署名のリプレイなど、6つの深刻な問題について検査できるよう支援します。
code-maturity-assessor
8.0kエージェントが、スマートコントラクトやブロックチェーンのコードベースを、9つの成熟度の観点で評価し、根拠と改善の優先順位を示せるよう支援します。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。