algorand-vulnerability-scanner
Fungsinya
Memeriksa smart contract Algorand untuk kelemahan keamanan yang sudah dikenal, seperti serangan rekeying, pemeriksaan field yang hilang, dan masalah kontrol akses. Skill ini untuk auditor dan developer yang menulis atau meninjau proyek Algorand.
Kapan dipakai
- ✓Saat developer meninjau proyek Algorand yang ditulis dalam TEAL atau PyTeal.
- ✓Saat auditor menginginkan pemeriksaan keamanan pra-audit untuk aplikasi Algorand.
- ✓Saat tim ingin memastikan perbaikan untuk kerentanan Algorand yang dilaporkan.
Link skill
https://github.com/trailofbits/skills/blob/main/plugins/building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Pindai kontrak PyTeal Algorand saya untuk masalah keamanan umum sebelum saya kirim ke auditor.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill ini mencari 11 pola yang sudah dikenal dan spesifik untuk model transaksi Algorand, lalu melaporkan kecocokan beserta penjelasannya. Skill ini juga bisa menjalankan alat analisis statis bernama Tealer.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Kode apa yang dibaca?
Skill ini membaca file assembly TEAL dan kode Python PyTeal.
Apakah ini menggantikan audit profesional?
Skill ini diposisikan sebagai pemeriksaan pra-audit, jadi berguna sebagai tahap pertama, bukan tinjauan lengkap.
Apa itu Tealer?
Tealer adalah alat analisis statis dari Trail of Bits yang bisa dijalankan skill ini pada kontrak Algorand.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 8.0k
- Peringkat
- #12656
- Lisensi
- CC-BY-SA-4.0
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
audit-context-building
8.0kMembantu agent Anda mempelajari basis kode yang belum dikenal sebelum tinjauan keamanan, dengan memetakan apa yang diasumsikan, dijamin, dan bergantung pada setiap fungsi.
audit-prep-assistant
8.0kMembantu agent Anda menyiapkan basis kode untuk tinjauan keamanan dari luar, dengan analisis statis, cakupan tes, pembersihan kode mati, dan dokumentasi yang jelas.
cairo-vulnerability-scanner
8.0kMembantu agent Anda memindai smart contract Cairo di StarkNet untuk 6 masalah serius, termasuk overflow aritmetika, pesan lintas lapisan yang berisiko, dan replay tanda tangan.
code-maturity-assessor
8.0kMembantu agent Anda memberi skor kematangan smart contract atau basis kode blockchain di 9 area, dengan bukti dan daftar prioritas perbaikan.
Skill serupa
reverse-engineer-anything
422kMembantu agent Anda memeriksa aplikasi dan paket yang sudah dirilis untuk menjelaskan fitur, membandingkan versi, atau memandu pembangunan ulang dengan alat REA.
1password
394kMembantu agent Anda mengatur CLI 1Password, masuk, serta membaca atau menyisipkan rahasia tanpa menampilkan nilainya di chat.
healthcheck
394kMembantu agent Anda mengaudit komputer atau server OpenClaw dari risiko keamanan seperti SSH, firewall, pembaruan, dan cadangan, lalu menyarankan perbaikan aman.