[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FJH063CN8PFD0CC093PH6V":3,"skill-same:01M6FJH063CN8PFD0CC093PH6V":50},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":25,"frontMatter":26,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M6FJH063CN8PFD0CC093PH6V","algorand-vulnerability-scanner",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Ftrailofbits\u002Fskills\u002Falgorand-vulnerability-scanner\u002FSKILL.md",[],[18,19,20,21,22],"vulnerability","vulnerability scanner","scanner","algorand","algorand vulnerability scanner","2026-11-10 10:12:30",false,"# Algorand Vulnerability Scanner\n\n## 1. Purpose\n\nSystematically 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.\n\n## 2. When to Use This Skill\n\n- Auditing Algorand smart contracts (stateful applications or smart signatures)\n- Reviewing TEAL assembly or PyTeal code\n- Pre-audit security assessment of Algorand projects\n- Validating fixes for reported Algorand vulnerabilities\n- Training team on Algorand-specific security patterns\n\n## 3. Platform Detection\n\n### File Extensions & Indicators\n- **TEAL files**: `.teal`\n- **PyTeal files**: `.py` with PyTeal imports\n\n### Language\u002FFramework Markers\n```python\n# PyTeal indicators\nfrom pyteal import *\nfrom algosdk import *\n\n# Common patterns\nTxn, Gtxn, Global, InnerTxnBuilder\nOnComplete, ApplicationCall, TxnType\n@router.method, @Subroutine\n```\n\n### Project Structure\n- `approval_program.py` \u002F `clear_program.py`\n- `contract.teal` \u002F `signature.teal`\n- References to Algorand SDK or Beaker framework\n\n### Tool Support\n- **Tealer**: Trail of Bits static analyzer for Algorand\n- Installation: `pip3 install tealer`\n- Usage: `tealer contract.teal --detect all`\n\n---\n\n## 4. How This Skill Works\n\nWhen invoked, I will:\n\n1. **Search your codebase** for TEAL\u002FPyTeal files\n2. **Analyze each file** for the 11 vulnerability patterns\n3. **Report findings** with file references and severity\n4. **Provide fixes** for each identified issue\n5. **Run Tealer** (if installed) for automated detection\n\n---\n\n## 5. Example Output\n\nWhen vulnerabilities are found, you'll get a report like this:\n\n```\n=== ALGORAND VULNERABILITY SCAN RESULTS ===\n\nProject: my-algorand-dapp\nFiles Scanned: 3 (.teal, .py)\nVulnerabilities Found: 2\n\n---\n\n[CRITICAL] Rekeying Attack\nFile: contracts\u002Fapproval.py:45\nPattern: Missing RekeyTo validation\n\nCode:\n    If(Txn.type_enum() == TxnType.Payment,\n        Seq([\n            # Missing: Assert(Txn.rekey_to() == Global.zero_address())\n            App.globalPut(Bytes(\"balance\"), balance + Txn.amount()),\n            Approve()\n        ])\n    )\n\nIssue: The contract doesn't validate the RekeyTo field, allowing attackers\nto change account authorization and bypass restrictions.\n\n\n---\n\n## 5. Vulnerability Patterns (11 Patterns)\n\nI check for 11 critical vulnerability patterns unique to Algorand. For detailed detection patterns, code examples, mitigations, and testing strategies, see [VULNERABILITY_PATTERNS.md](resources\u002FVULNERABILITY_PATTERNS.md).\n\n### Pattern Summary:\n\n1. **Rekeying Vulnerability** ⚠️ CRITICAL - Unchecked RekeyTo field\n2. **Missing Transaction Verification** ⚠️ CRITICAL - No GroupSize\u002FGroupIndex checks\n3. **Group Transaction Manipulation** ⚠️ HIGH - Unsafe group transaction handling\n4. **Asset Clawback Risk** ⚠️ HIGH - Missing clawback address checks\n5. **Application State Manipulation** ⚠️ MEDIUM - Unsafe global\u002Flocal state updates\n6. **Asset Opt-In Missing** ⚠️ HIGH - No asset opt-in validation\n7. **Minimum Balance Violation** ⚠️ MEDIUM - Account below minimum balance\n8. **Close Remainder To Check** ⚠️ HIGH - Unchecked CloseRemainderTo field\n9. **Application Clear State** ⚠️ MEDIUM - Unsafe clear state program\n10. **Atomic Transaction Ordering** ⚠️ HIGH - Assuming transaction order\n11. **Logic Signature Reuse** ⚠️ HIGH - Logic sigs without uniqueness constraints\n\nFor complete vulnerability patterns with code examples, see [VULNERABILITY_PATTERNS.md](resources\u002FVULNERABILITY_PATTERNS.md).\n## 5. Scanning Workflow\n\n### Step 1: Platform Identification\n1. Confirm file extensions (`.teal`, `.py`)\n2. Identify framework (PyTeal, Beaker, pure TEAL)\n3. Determine contract type (stateful application vs smart signature)\n4. Locate approval and clear state programs\n\n### Step 2: Static Analysis with Tealer\n```bash\n# Run Tealer on contract\ntealer contract.teal --detect all\n\n# Or specific detectors\ntealer contract.teal --detect unprotected-rekey,group-size-check,update-application-check\n```\n\n### Step 3: Manual Vulnerability Sweep\nFor each of the 11 vulnerabilities above:\n1. Search for relevant transaction field usage\n2. Verify validation logic exists\n3. Check for bypass conditions\n4. Validate inner transaction handling\n\n### Step 4: Transaction Field Validation Matrix\nCreate checklist for all transaction types used:\n\n**Payment Transactions**:\n- [ ] RekeyTo validated\n- [ ] CloseRemainderTo validated\n- [ ] Fee validated (if smart signature)\n\n**Asset Transfers**:\n- [ ] Asset ID validated\n- [ ] AssetCloseTo validated\n- [ ] RekeyTo validated\n\n**Application Calls**:\n- [ ] OnComplete validated\n- [ ] Access controls enforced\n- [ ] Group size validated\n\n**Inner Transactions**:\n- [ ] Fee explicitly set to 0\n- [ ] RekeyTo not user-controlled (Teal v6+)\n- [ ] All fields validated\n\n### Step 5: Group Transaction Analysis\nFor atomic transaction groups:\n1. Validate `Global.group_size()` checks\n2. Review absolute vs relative indexing\n3. Check for replay protection (Lease field)\n4. Verify OnComplete fields for ApplicationCalls in group\n\n### Step 6: Access Control Review\n- [ ] Creator\u002Fadmin privileges properly enforced\n- [ ] Update\u002Fdelete operations protected\n- [ ] Sensitive functions have authorization checks\n\n---\n\n## 6. Reporting Format\n\n### Finding Template\n```markdown\n## [SEVERITY] Vulnerability Name (e.g., Missing RekeyTo Validation)\n\n**Location**: `contract.teal:45-50` or `approval_program.py:withdraw()`\n\n**Description**:\nThe contract approves payment transactions without validating the RekeyTo field, allowing an attacker to rekey the account and bypass future authorization checks.\n\n**Vulnerable Code**:\n```python\n# approval_program.py, line 45\nIf(Txn.type_enum() == TxnType.Payment,\n    Approve()  # Missing RekeyTo check\n)\n```\n\n**Attack Scenario**:\n1. Attacker submits payment transaction with RekeyTo set to attacker's address\n2. Contract approves transaction without checking RekeyTo\n3. Account authorization is rekeyed to attacker\n4. Attacker gains full control of account\n\n**Recommendation**:\nAdd explicit validation of the RekeyTo field:\n```python\nIf(And(\n    Txn.type_enum() == TxnType.Payment,\n    Txn.rekey_to() == Global.zero_address()\n), Approve(), Reject())\n```\n\n**References**:\n- building-secure-contracts\u002Fnot-so-smart-contracts\u002Falgorand\u002Frekeying\n- Tealer detector: `unprotected-rekey`\n```\n\n---\n\n## 7. Priority Guidelines\n\n### Critical (Immediate Fix Required)\n- Rekeying attacks\n- CloseRemainderTo \u002F AssetCloseTo issues\n- Access control bypasses\n\n### High (Fix Before Deployment)\n- Unchecked transaction fees\n- Asset ID validation issues\n- Group size validation\n- Clear state transaction checks\n\n### Medium (Address in Audit)\n- Inner transaction fee issues\n- Time-based replay attacks\n- DoS via asset opt-in\n\n---\n\n## 8. Testing Recommendations\n\n### Unit Tests Required\n- Test each vulnerability scenario with PoC exploit\n- Verify fixes prevent exploitation\n- Test edge cases (group size = 0, empty addresses, etc.)\n\n### Tealer Integration\n```bash\n# Add to CI\u002FCD pipeline\ntealer approval.teal --detect all --json > tealer-report.json\n\n# Fail build on critical findings\ntealer approval.teal --detect all --fail-on critical,high\n```\n\n### Scenario Testing\n- Submit transactions with all critical fields manipulated\n- Test atomic groups with unexpected sizes\n- Attempt access control bypasses\n- Verify inner transaction fee handling\n\n---\n\n## 9. Additional Resources\n\n- **Building Secure Contracts**: `building-secure-contracts\u002Fnot-so-smart-contracts\u002Falgorand\u002F`\n- **Tealer Documentation**: https:\u002F\u002Fgithub.com\u002Fcrytic\u002Ftealer\n- **Algorand Developer Docs**: https:\u002F\u002Fdeveloper.algorand.org\u002Fdocs\u002F\n- **PyTeal Documentation**: https:\u002F\u002Fpyteal.readthedocs.io\u002F\n\n---\n\n## 10. Quick Reference Checklist\n\nBefore completing Algorand audit, verify ALL items checked:\n\n- [ ] RekeyTo validated in all transaction types\n- [ ] CloseRemainderTo validated in payment transactions\n- [ ] AssetCloseTo validated in asset transfers\n- [ ] Transaction fees validated (smart signatures)\n- [ ] Group size validated for atomic transactions\n- [ ] Lease field used for replay protection (where applicable)\n- [ ] Access controls on Update\u002FDelete operations\n- [ ] Asset ID validated in all asset operations\n- [ ] Asset transfers use pull pattern to avoid DoS\n- [ ] Inner transaction fees explicitly set to 0\n- [ ] OnComplete field validated for ApplicationCall transactions\n- [ ] Tealer scan completed with no critical\u002Fhigh findings\n- [ ] Unit tests cover all vulnerability scenarios\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Ftrailofbits\u002Fskills\u002Falgorand-vulnerability-scanner",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill algorand-vulnerability-scanner",{"tool":42,"command":43},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill algorand-vulnerability-scanner",{"tool":45,"command":46},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill algorand-vulnerability-scanner","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Ftrailofbits\u002Fskills\u002Falgorand-vulnerability-scanner\u002FSKILL.md",true,[],[51,60,69,78,84,90],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":23},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[57,58,59],"model","model hierarchy","model hierarchy skill",{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":23},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[66,67,68],"MCP","zoom","zoom mcp",{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":23},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[75,76,77,67],"sdk","zoom apps sdk","apps",{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":23},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[80],{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":23},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[86],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":23},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[92]]