AP

A specialized security auditing tool for Aptos-specific Move smart contract development.

Install

mkdir -p .claude/skills/aptos-scanner && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11078" && unzip -o skill.zip -d .claude/skills/aptos-scanner && rm skill.zip

Installs to .claude/skills/aptos-scanner

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when the user wants to audit Aptos Move smart contracts, scan Aptos-specific patterns including global storage model, resource accounts, or coin modules, review Aptos DeFi protocols for framework module interaction vulnerabilities, or analyze Aptos-specific upgrade and governance patterns.
294 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Audit Aptos Move contracts
  • Scan for resource safety issues
  • Review framework module interactions
  • Analyze upgrade patterns

How it works

It scans Move code for Aptos-specific patterns like global resource access, resource account capabilities, and framework module usage.

Inputs & outputs

You give it
Aptos Move source code
You get back
Security audit report

When to use aptos-scanner

  • Auditing Aptos Move contracts
  • Scanning for resource safety issues
  • Reviewing DeFi protocol interactions

About this skill

Aptos Specialized Scanner

Specialized security scanner for Aptos Move smart contracts. Extends the general Move Scanner with Aptos-specific patterns, framework modules, and the global storage model.


Why a Separate Aptos Scanner?

While the Move Scanner covers language-level patterns shared between Aptos and Sui, Aptos has a fundamentally different storage model (global resources under addresses), framework (AptosFramework), and upgrade system that require dedicated detection rules.

FeatureAptosSui
StorageGlobal resources under addressesObject model
Resource accessmove_to, borrow_global, move_fromPassed as function parameters
UpgradeModule upgrade with compatibility policyPackage upgrade with UpgradeCap
Tokensaptos_framework::coinsui::coin with TreasuryCap
AccountsAccount + AuthenticationKeyNo account concept
Randomnessaptos_framework::randomness (commit-reveal)sui::random

Detection Capabilities

CategoryDetectionSeverity
Resource SafetyResource created but never stored (move_to missing)High
Resource Safetyborrow_global_mut without authorization checkCritical
Resource Safetymove_from extracting resource without ownership proofCritical
Resource SafetyMissing exists<T>(addr) check before accessMedium
AbilitiesValue-holding type with copy ability (duplication)Critical
AbilitiesCapability with drop (can be silently discarded)High
UpgradeModule upgrade authority is single EOAHigh
Upgradecompatible upgrade policy on critical moduleMedium
CoinMintCapability stored in publicly accessible locationCritical
CoinCoinStore registration not checked before depositMedium
AuthMissing signer parameter on privileged entry functionCritical
Authsigner::address_of() not compared to authorized addressHigh
AuthResource account SignerCapability exposed publiclyCritical
StorageTable/SimpleMap with unbounded growthMedium
Storageacquires annotation missing (compile-time, but indicates design)Low
EventsState change without event emissionLow

Aptos Framework Security-Critical Modules

ModuleFunctions to AuditKey Risk
aptos_framework::coininitialize, mint, burn, transfer, registerCap management
aptos_framework::accountcreate_account, rotate_authentication_keyAuth key rotation
aptos_framework::resource_accountcreate_resource_account, retrieve_resource_account_capSigner cap leak
aptos_framework::objectcreate_object, transfer, generate_signerObject ownership
aptos_framework::fungible_assetmint, burn, transfer, deposit, withdrawNew token standard
aptos_framework::multisig_accountcreate, execute_transactionMultisig logic
aptos_framework::staking_contractcreate_staking_contract, distributeReward calculation
aptos_framework::governancecreate_proposal, voteVoting power

Common Aptos Vulnerability Examples

Resource Account Signer Capability Leak

// CRITICAL: SignerCapability stored with 'store' ability allows extraction
struct ResourceAccountCap has key, store {
    signer_cap: account::SignerCapability,
}

// If anyone can get a reference to this struct, they can create a signer
// for the resource account and drain all its assets
public fun get_resource_signer(cap: &ResourceAccountCap): signer {
    account::create_signer_with_capability(&cap.signer_cap)
}

// SAFE: No public accessor, internal only
struct ResourceAccountCap has key {
    signer_cap: account::SignerCapability,
}

fun internal_get_signer() acquires ResourceAccountCap {
    let cap = borrow_global<ResourceAccountCap>(@resource_addr);
    let signer = account::create_signer_with_capability(&cap.signer_cap);
    // Use signer internally only
}

Coin Registration Race Condition

// VULNERABLE: Depositing without checking CoinStore registration
public fun distribute_rewards(recipients: &vector<address>) {
    let i = 0;
    while (i < vector::length(recipients)) {
        let addr = *vector::borrow(recipients, i);
        // ABORTS if addr doesn't have CoinStore<RewardToken> registered!
        coin::deposit(addr, reward_coins);
        i = i + 1;
    };
}

// SAFE: Check registration first
public fun distribute_rewards(recipients: &vector<address>) {
    let i = 0;
    while (i < vector::length(recipients)) {
        let addr = *vector::borrow(recipients, i);
        if (coin::is_account_registered<RewardToken>(addr)) {
            coin::deposit(addr, reward_coins);
        } else {
            // Handle: skip, queue for later, or register for them
        };
        i = i + 1;
    };
}

Resources

Workflows

See Also

Error Code Reference

Aptos-specific error codes and framework abort codes. Aptos uses the Move abort system with standard error categories.

Aptos Error Categories (std::error)

CategoryConstantHex PrefixMeaning
INVALID_ARGUMENT10x1____Bad input parameter
OUT_OF_RANGE20x2____Value outside acceptable range
NOT_FOUND60x6____Resource or item not found
ALREADY_EXISTS80x8____Resource or item already exists
PERMISSION_DENIED50x5____Insufficient permissions
RESOURCE_EXHAUSTED90x9____Limit reached (e.g., max supply)
UNAVAILABLE130xD____Temporarily unavailable

Aptos Framework Errors

Abort CodeModuleMeaning
0x10006coinCoin store not registered for address
0x10007coinInsufficient coin balance
0x80001accountAccount already exists
0x80002accountAccount not found
0x50001tableKey already exists
0x50002tableKey not found
0x60001coinCoin amount is zero
0x90001resource_accountResource account already exists
ENOT_OWNERCommonSigner is not the owner — access control check
ENOT_AUTHORIZEDCommonLacking required authorization

Aptos Token / NFT Errors

Abort CodeModuleMeaning
ETOKEN_NOT_FOUNDtokenToken or collection does not exist
ECOLLECTION_NOT_FOUNDtokenCollection does not exist
EINSUFFICIENT_BALANCEtokenToken balance too low for operation
ENOT_CREATORtokenCaller is not the collection creator
EFIELD_NOT_MUTABLEtokenAttempting to modify immutable field

Troubleshooting

IssueLikely CauseSolution
Global storage vulnerabilities missedScanner doesn't audit borrow_global / move_to patternsMap all global storage operations; check exists<T> before borrow_global and move_to
Resource account risks not flaggedScanner doesn't track SignerCapability lifecycleTrace resource_account::create_resource_account and verify SignerCapability storage/access
Module upgrade attack surface ignoredScanner only checks current codeVerify UpgradePolicy (immutable vs compatible); check who holds the UpgradeCap
View functions not auditedScanner focuses on entry functionsView functions can leak sensitive state; audit all #[view] functions for information disclosure
Event emission gaps not detectedScanner doesn't check event coverageVerify all state-changing operations emit events for off-chain tracking
Coin type confusion not caughtScanner trusts Move type systemVerify all coin operations use correct type parameters; check for CoinType aliasing

When not to use it

  • Non-Aptos Move contracts
  • General web application code

Prerequisites

Move source code

Limitations

  • Requires Aptos-specific knowledge
  • Does not replace manual audit

How it compares

It focuses on Aptos-specific storage and framework security rather than generic Move language patterns.

Compared to similar skills

aptos-scanner side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
aptos-scanner (this skill)05moNo flagsAdvanced
backend-security-coder244moNo flagsIntermediate
xss-testing17moReviewAdvanced
permission-model-change-guide13moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry