Rules › Anchor (Rust)
Authority account that isn't a Signer
An authority, admin or owner account that isn't Signer<'info> (or signer constrained) lets anyone pass someone else's key.
Why it matters
Solana instructions receive accounts as a list chosen by the caller. If an authority account isn't required to sign, anyone can pass the real authority's public key and act as them. Authorities must be Signer<'info> (or carry a signer constraint) and be tied to the state they control with has_one or a constraint.
Vulnerable
#[derive(Accounts)]
pub struct Withdraw<'info> {
#[account(mut)]
pub vault: Account<'info, Vault>,
pub authority: AccountInfo<'info>,
}
Fixed
#[derive(Accounts)]
pub struct Withdraw<'info> {
#[account(mut, has_one = authority)]
pub vault: Account<'info, Vault>,
pub authority: Signer<'info>,
}
What other tools call it
| Tool | Detector or reference |
|---|---|
| Sealevel attacks | 0-signer-authorization |
Check your code
Paste a contract into the in-browser checker, or let the Claude Code plugin scan before every deploy. The quick check for this rule is a pattern match: treat a hit as "look here", and a miss as no guarantee.
Related rules
- Unchecked account without a /// CHECK: note
- CPI to a program the caller chooses
- Account data deserialized without an owner check
- init_if_needed (reinitialization risk)
- Account closed by draining lamports by hand
- overflow-checks not enabled for release builds
Static analysis finds known bug classes; it can't prove code is safe and isn't an audit. Get a professional audit before deploying code that will hold value.