home / skills / plurigrid / asi / algorand-vulnerability-scanner

algorand-vulnerability-scanner skill

/skills/algorand-vulnerability-scanner

This skill scans Algorand smart contracts for 11 vulnerabilities to help auditors detect rekeying, missing validations, and access control flaws.

npx playbooks add skill plurigrid/asi --skill algorand-vulnerability-scanner

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.6 KB
---
name: algorand-vulnerability-scanner
description: 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). (project, gitignored)
category: building-secure-contracts
author: Trail of Bits
source: trailofbits/skills
license: AGPL-3.0
trit: -1
trit_label: MINUS
verified: true
featured: false
---

# Algorand Vulnerability Scanner Skill

**Trit**: -1 (MINUS)
**Category**: building-secure-contracts
**Author**: Trail of Bits
**Source**: trailofbits/skills
**License**: AGPL-3.0

## Description

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). (project, gitignored)

## When to Use

This is a Trail of Bits security skill. Refer to the original repository for detailed usage guidelines and examples.

See: https://github.com/trailofbits/skills

## Related Skills

- audit-context-building
- codeql
- semgrep
- variant-analysis


## SDF Interleaving

This skill connects to **Software Design for Flexibility** (Hanson & Sussman, 2021):

### Primary Chapter: 4. Pattern Matching

**Concepts**: unification, match, segment variables, pattern

### GF(3) Balanced Triad

```
algorand-vulnerability-scanner (○) + SDF.Ch4 (+) + [balancer] (−) = 0
```

**Skill Trit**: 0 (ERGODIC - coordination)


### Connection Pattern

Pattern matching extracts structure. This skill recognizes and transforms patterns.

Overview

This skill scans Algorand smart contracts (TEAL and PyTeal) for 11 common vulnerabilities, including rekeying attacks, unchecked transaction fees, missing field validations, and access control weaknesses. It is designed to support security reviews and audits of Algorand projects by automatically flagging risky patterns and likely misconfigurations. The scanner is implemented in Python and focuses on practical findings that auditors and developers can act on quickly.

How this skill works

The scanner parses TEAL and PyTeal sources to extract operations, transaction fields, and approval/clear state logic. It applies a set of pattern-based checks to detect issues such as rekeying opportunities, missing verifies on transaction fields, unchecked fee or foreign asset handling, and lax access controls. For each finding it reports the location, the matched pattern, and a concise remediation suggestion.

When to use it

  • During security audits of Algorand smart contracts written in TEAL or PyTeal.
  • Before deployment to catch common mistakes that lead to fund loss or privilege escalation.
  • When reviewing contributions or pull requests that modify contract logic or transaction handling.
  • As part of a CI pipeline to prevent regressions in contract safety checks.

Best practices

  • Run the scanner early and often during development to catch issues before deployment.
  • Treat findings as prioritized leads, not final judgments—verify each issue manually in context.
  • Combine automated scanning with manual code review and formal testing for high-risk contracts.
  • Keep contract logic simple and ensure explicit checks for sender, rekey, and fee-related fields.
  • Integrate scanner results into your CI so fixes are enforced before merging.

Example use cases

  • Auditing an Algorand payment gateway contract to ensure fee handling cannot be abused.
  • Reviewing a PyTeal-based multisig or escrow contract for rekey and access-control flaws.
  • Scanning a repository of TEAL scripts in CI to prevent accidental acceptance of unsafe patterns.
  • Validating third-party contract contributions for missing field validations or unchecked foreign assets.

FAQ

Which languages and formats does the scanner support?

It supports TEAL source and PyTeal code by parsing contract logic and transaction constructs.

Are findings definitive proof of exploitable bugs?

No. Findings indicate likely issues based on pattern matching; each should be reviewed and tested in the contract's full context.