/auditsentry:access-controlfrom auditsentry
Detects missing or incorrect access control in Solidity smart contracts: missing modifiers, wrong role checks, public initializers, tx.origin auth, and role-escalation paths. Activates on state-mutating functions.
Ships in auditsentry. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Any state-mutating function. In particular:
setOwner, transferOwnership, grantRole, setAdmin, setMinterupgradeTo, _authorizeUpgrade, proxy adminsinitialize, __Init, _init)msg.sender == tx.origin or address checks against a single static valuefunction mint(address to, uint256 amount) external {
_mint(to, amount); // ← anyone can mint
}
function setFee(uint256 fee) external {
require(msg.sender == owner || hasRole(USER, msg.sender)); // ← USER role can set fee
fee_ = fee;
}
function initialize(address admin) public { // ← no initializer guard, anyone can re-init
_grantRole(DEFAULT_ADMIN_ROLE, admin);
}
See also: [[initialization]]
require(tx.origin == owner); // ← phishable via intermediate contract
Sometimes a setter is internal but a public wrapper exists with weak checks. Search for "alternate paths" to the same state slot.
DEFAULT_ADMIN_ROLE can grant itself any role. If the admin is an EOA, a single key compromises everything. Look for renounceable admin patterns or multi-sig requirements.
selfdestruct reachable without ownership check (CRITICAL — but see [[selfdestruct-eip6780]])function rescue(IERC20 token) external onlyOwner {
token.transfer(owner, token.balanceOf(address(this))); // ← sweeps any token incl. user deposits
}
Critical if it can sweep user deposits, Medium if only stuck airdrops.
| Pattern | Severity |
|---|---|
| Privileged mint/burn with no auth | Critical |
Public initialize on a deployed proxy | Critical |
| Owner sweep that includes user deposits | Critical |
| Wrong role guards a sensitive op | High |
tx.origin auth | High |
| Centralized single-key admin with no timelock | High (see [[centralization-risk]]) |
| Renounced ownership but admin role retained | Medium |
| Missing zero-address check on role grant | Low |
OwnableUpgradeable / AccessControlUpgradeable from OZ — never roll your own._disableInitializers() in the constructor, initializer modifier on init.DEFAULT_ADMIN_ROLE. Document the timelock duration.Ownable2Step) to prevent locking out the contract.denylist user-deposit tokens.claim() for caller) is fine — verify intent against the spec.What SKILL.md sets; muted values are Claude Code's defaults
45 skills in this plugin
/approval-issuesDetect ERC-20 approval pitfalls — approve race (front-run), missing safeApprove, infinite approvals, approval-without-revoke, Permit2 misuse, max-approval to untrusted contracts. Activate on `approve`, `safeApprove`, `permit`, `forceApprove`, `Permit2`, `IERC20.allowance`./caching-and-incrementalAlways-on meta-skill — cache audit results per file by content hash so unchanged files aren't re-analyzed on subsequent runs. Activate on every /audit, /quick-scan, /audit-changes invocation./centralization-riskDetect centralization and trust-assumption risks — admin powers, single-key risk, missing timelocks, upgrade authority, treasury keys, pause permanence, blacklisting authority, oracle authority. Activate on `onlyOwner`, `onlyRole`, `AccessControl`, upgrade authorizations, pause/unpause functions, mint/burn caps, treasury/fee setters./confidence-scoringAlways-on meta-skill — for every finding produced, attach a confidence level (HIGH/MEDIUM/LOW) and a reasoning trace. Activate on every /audit, /audit-deep, /audit-changes, /audit-live, /quick-scan invocation./cosmwasmDetect bug classes specific to CosmWasm (Rust) contracts — missing info.sender authorization in execute handlers, unbounded map iteration → gas/DoS, reply/submessage reply_id confusion, migrate admin backdoors, addr_validate vs raw string addresses, unchecked info.funds, Uint128 overflow, query reentrancy, and migration/version state. Activate on any `.rs` file with `use cosmwasm_std`, `#[entry_point]`, `ExecuteMsg`, `InstantiateMsg`, `QueryMsg`, `cw_storage_plus`, or `DepsMut`./cross-chain-messagingDetect cross-chain messaging bugs — replay protection gaps, untrusted-remote acceptance, default-config inheritance, validator-set misconfig, force-include vulnerabilities, chainId / domain-separator omissions. Activate on `_lzReceive`, `ccipReceive`, `handle` (Hyperlane), `receiveMessage`, `verifyVAA`, IRouterClient, IMailbox, EndpointV2, OApp/OFT, LayerZero / CCIP / Hyperlane / Wormhole / Axelar / Polyhedra integration code.npx claudepluginhub iktok90-design/ai-smart-contract-auditor --plugin auditsentryOther plugins' skills for the same job