algorand-vulnerability-scanner
하는 일
키 재설정(rekeying) 공격, 누락된 필드 검사, 접근 제어 문제처럼 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는 무엇인가요?
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개 성숙도 영역으로 평가하고, 근거와 개선 우선순위 목록을 제공하도록 돕습니다.