07 — OpSec & Governance Checklist
Domain: Operational Security, Program Deployment, Governance
Severity if missed: CRITICAL to HIGH
References: Solana program upgrade authority, Squads multisig, timelock patterns
Every item below is a single verification step. Mark each [PASS], [FAIL-{severity}], [PARTIAL], or [N/A].
7.1 — Program Upgrade Authority
- OPS-001: What is the current upgrade authority of the deployed program? (run
solana program show <PROGRAM_ID>) - OPS-002: Is the upgrade authority a multisig (e.g., Squads v3/v4)? If it's a single wallet — flag as HIGH
- OPS-003: How many signers are required on the multisig? Verify threshold (e.g., 2/3, 3/5)
- OPS-004: Who are the individual signers on the multisig? Are they different entities?
- OPS-005: Are the multisig signers on hardware wallets (Ledger, etc.) or hot wallets?
- OPS-006: Is there a timelock on program upgrades? How many hours/days?
- OPS-007: If there is a timelock — is it enforced on-chain or just a team policy?
- OPS-008: Recommended minimum timelock: 24 hours for DeFi programs, 72 hours for critical infrastructure
- OPS-009: Can the upgrade authority be changed? Who can change it?
- OPS-010: Is the program set to non-upgradeable (immutable)? If not, should it be? Document reasoning
- OPS-011: If program is upgradeable — can a malicious upgrade drain all funds? (Yes, by definition — hence multisig + timelock)
- OPS-012: Is there a process for emergency upgrades that bypass the timelock? If yes, what are the safeguards?
7.2 — Backdoor Detection
- OPS-013: Search for hidden admin instructions — any instruction that accepts a hardcoded admin pubkey (not visible in docs/IDL)
- OPS-014: Search for "god mode" accounts — any account that can bypass all access control checks
- OPS-015: Search for conditional logic based on specific pubkeys:
if account.key() == Pubkey::new_from_array([...])hidden checks - OPS-016: Search for unused instruction handlers that could be invoked — dead code that's still callable
- OPS-017: Verify IDL matches the actual program binary — no undisclosed instructions
- OPS-018: Check for instructions that can modify the Treasury pubkey to redirect fees
- OPS-019: Check for instructions that can modify a stored external program ID (e.g. DEX/aggregator router, oracle, staking or lending program) to redirect CPIs
- OPS-020: Check for instructions that can replace a privileged role (e.g. vault operator, pool/market admin, lending risk admin, stake-pool manager) without the timelock, governance vote or user opt-out the protocol promises
- OPS-021: Check for instructions that can mint claim tokens without a matching deposit (e.g. vault shares, LP tokens, lending receipt tokens, liquid-staking tokens) — dilution
- OPS-022: Check for instructions that can burn or seize a user's claim tokens or positions without the user's withdrawal (outside a documented liquidation path) — theft
- OPS-023: Search for
unsafeblocks in Rust code — any usage must be documented and justified - OPS-024: Search for raw pointer manipulation (
*const,*mut) — should not exist in Anchor programs - OPS-025: Check
declare_id!matches between code and Anchor.toml — mismatch could mean wrong program - OPS-026: Verify program binary matches published source code (verifiable builds)
7.3 — Key Management
- OPS-027: Deploy keypair — is it on a hardware wallet for mainnet?
- OPS-028: Deploy keypair — is it stored securely (not in repo, not on dev machine in plaintext)?
- OPS-029: Privileged-role wallets (e.g. admin, operator, pool/market authority, oracle or price-update signer) — are they on hardware wallets or multisig for mainnet?
- OPS-030: Keeper / crank / relayer wallet that holds an on-chain role (if any) — is that role the minimum privilege the program needs (it can crank, not withdraw or reconfigure)?
- OPS-031: Keeper / crank / relayer wallet — does it hold significant SOL/tokens? (Should only hold fees and rent)
- OPS-036: Has any key ever been committed to git? Check
GIT_NO_LAZY_FETCH=1 git --no-pager -c core.fsmonitor=false -c log.showSignature=false log --all --oneline --no-textconv --no-ext-diff -S "secret_string"patterns (OUTPUT-RULES Rule 11c flags)
7.4 — Multisig Configuration
- OPS-037: Is a multisig used for on-chain operations? Which platform? (Squads, Goki, Marinade, custom)
- OPS-038: Multisig threshold — is it > 50% of total signers? (e.g., 2/3 minimum)
- OPS-039: Multisig — does any single signer have disproportionate power?
- OPS-040: Multisig — are there backup signers in case one is compromised or unavailable?
- OPS-041: Multisig — can a single compromised signer change the threshold to 1/N?
- OPS-042: Multisig — is there a proposal expiry? Can old proposals be executed weeks later?
- OPS-043: Multisig — are executed transactions logged and auditable?
7.5 — Incident Response
- OPS-044: Is there a documented incident response plan?
- OPS-045: Can the program be paused in an emergency? By whom? How quickly?
- OPS-046: Is there a bug bounty program? (Immunefi, HackerOne, or self-hosted)
- OPS-047: Is there a security contact (security@domain.com, SECURITY.md in repo)?
- OPS-048: Are there monitoring alerts for large value movements from program-owned vault/treasury PDAs?
- OPS-049: Are there monitoring alerts for program upgrade transactions?
- OPS-050: Are there monitoring alerts for unusual transaction patterns (many withdrawals, large swaps)?
- OPS-051: Is there a war room process? Who needs to be contacted and in what order?
- OPS-052: Post-incident: is there a process for post-mortem analysis?
7.6 — Timelock Analysis
- OPS-053: List ALL actions that are time-locked and their durations
- OPS-054: Program upgrades — timelock duration: _____ hours/days
- OPS-055: Fee changes — timelock duration: _____ hours/days (or "none" — flag if none)
- OPS-056: Privileged-role changes (admin, operator, oracle signer) — timelock duration: _____ hours/days (or "none")
- OPS-057: Whitelist changes — timelock duration: _____ hours/days (or "none")
- OPS-058: Treasury address changes — timelock duration: _____ hours/days (should be "immutable")
- OPS-059: Emergency bypass for timelock — what triggers it? How many signers?
- OPS-060: Transaction cancellation — can a time-locked transaction be cancelled before execution?
- OPS-061: Users notified of pending time-locked changes? (On-chain event, frontend alert, Discord)
7.7 — Access Segregation
- OPS-062: Localnet/devnet and mainnet deployments use completely separate program keypairs, upgrade authorities and admin keys
- OPS-063: No developer has production deploy access from their personal machine
- OPS-064: CI/CD pipeline — does it auto-deploy? If yes, what are the safeguards?
- OPS-067: Deploy, upgrade-authority and admin private keys — never in CI/CD environment variables or job logs in plaintext
- OPS-068: Where CI or scripts sign deploys or admin transactions, the key comes from a secrets manager, KMS/HSM or a multisig proposal flow — not a keypair file on a runner or developer machine
7.8 — Source Code Integrity
- OPS-069: Is the program source code open source?
- OPS-070: Does the published source match the deployed binary? (Verifiable builds via
anchor verify) - OPS-071: Can the audit check be reproduced? (
anchor buildproduces same binary) - OPS-072: Is the git history clean? (No force-pushes that remove commit history)
- OPS-073: Are there branch protection rules? (No direct push to main, required reviews)
- OPS-074: Is the CI/CD pipeline itself secured? (No PR can modify CI to skip checks)
- OPS-075: Dependencies are version-pinned (no
^or~in Cargo.toml for critical deps)
7.9 — Stake & Pre-Signed Governance Safety
- OPS-076: Stake-account Staker AND Withdrawer authority changes are monitored and allowlisted with equal severity — a Staker-only
Authorize(Withdrawer untouched) must not slip past withdrawal-focused monitoring, and batched authorize instructions are inspected (cross-ref KV-118) - OPS-077: Admin/governance instructions must NOT be reachable via durable-nonce pre-signed transactions that outlive the authorizing context — privileged paths are recent-blockhash-only (or version/epoch-guarded so a multisig migration invalidates stale pre-signed txs), plus a timelock and an aggregate-outflow circuit breaker (cross-ref KV-119)
- OPS-085: Privileged-instruction legibility at the signing council — are privileged/admin/authority-transfer instructions rendered HUMAN-READABLE at the multisig/governance signing surface (decoded or simulated at approval time, showing the target program, the instruction, and the mutated authority/value), AND is a decoder bot broadcasting the parsed admin action publicly during the timelock window so signers and the community can see what is being approved before it lands? (PASS: the signing UI decodes/simulates the instruction rather than presenting opaque bytes, a timelock separates approval from execution, and a public decode of the pending action is broadcast during that window; no opaque
set_authority/upgrade path can be approved sight-unseen; FAIL: the council approves raw, unparsed instruction bytes — the proximate enabler of the Drift incident, where an opaque privileged instruction was signed at the council. This is COUNCIL-side blind-signing and is distinct from end-user and autonomous-agent wallet blind-signing (out of scope for this skill), which concern a single principal's wallet rather than a multisig approving on behalf of the protocol.)
7.10 — Authority Rotation, Treasury & Config Hardening
- OPS-078: Admin authority is rotatable via a two-step
propose_admin/accept_adminhandshake backed by apending_admin: Option<Pubkey>field (a single immutable admin is a SPOF), and Critical rotation/action paths are gated by a timelock (SSB §24.2) - OPS-079: Fee/treasury account is validated at config-time for token-receiving capability (ATA compatibility) AND has a valid access-controlled sweep path — funds are recoverable via an authorized route, not merely pinned to an immutable address with no way out (SSB §31.4)
- OPS-080: Config-update APIs use a tri-state
Patch<T> { Unchanged, Set, Clear }rather than anOption<T>that conflates "not provided" with "clear to zero"; every config write-path validates new values against each other atomically; permissionless init decouples the creator identity from privileged authority and requires explicit authority acceptance (namespace-capture, SSB §29) - OPS-081: Verify the LIVE on-chain multisig threshold by fetching the account — confirm the actual configured threshold is ≥ ceil(N/2)+1, not just that a threshold field exists in the schema (Saga DAO 1-of-12 misconfig, $60K)
7.11 — Admin / Config Parameter Bounds & Interdependencies
Admin- and governance-set numeric parameters are a recurring high/critical surface: a value with no upper (or lower) bound, interdependent values validated one at a time so a valid-looking pair is mutually inconsistent, and a zero that later becomes a divisor or a degenerate curve. The write is fully authorized — the bug is that the setter accepts a value the rest of the program cannot safely consume. Enumerate every admin/config
set_*/update_*path and its numeric inputs. Grep hints:grep -rn --include="*.rs" -iE "set_|update_config|update_params|admin|governance|fee|weight|rate|ratio|threshold|min_|max_|buffer|require!|assert" programs/
- OPS-082: Every admin/config numeric has an enforced MIN and MAX — each settable parameter (fee bps, collateral/risk weight, LTV, rate, buffer, threshold, decimals, count) is validated at write-time against both a lower and an upper bound that the downstream math actually tolerates; no parameter is accepted merely because it deserializes. (PASS:
require!(v >= MIN && v <= MAX, ...)(or a bounded range) on every setter, with the bounds derived from what consumers can safely use; FAIL: a fee/weight/rate with only a one-sided check or none — e.g. a risk weight settable above 1.0 inflates borrowing power. Accretion MarginFi: emode weight settable> 1.0.) - OPS-083: Interdependent config values are cross-validated atomically at write-time — when parameters constrain each other (
min < max,cliff <= duration,initial_reservevsthreshold,buffervssqrt_price, tier ordering), the setter validates the WHOLE resulting config as a unit against the incoming params in the same instruction, not each field independently or against stale state read later. (PASS: full consistency asserted atomically from the update params before commit; FAIL: fields set/checked piecemeal so an individually-valid write produces a mutually-inconsistent config. Zenith Meteora: sqrt-price buffer relationship; Sec3 Invariant: tick parameter consistency.) - OPS-084: A zero that would cause div-by-zero or degenerate math is rejected — any config value used as a denominator, a scaling base, a supply, a duration, or a tick/precision unit is validated
!= 0(and above any minimum that avoids degenerate math) at write-time, so it cannot brick or trivially skew a later instruction. (PASS: explicit non-zero / minimum guard on every parameter that feeds a division or a curve base; FAIL: a settable duration/divisor/tick accepts0, panicking (div-by-zero) or producing degenerate pricing on the next use. Halborn Raydium: vesting div-by-zero from a zero duration / cliff config.)
7.12 — Governance Timelocks & Signing Windows at 200 ms Slots (SIMD-0525)
The timelock is the control that gives the community time to catch a malicious proposal (BonkDAO, Jul 2026: a hidden treasury transfer inside BIP-76). A timelock stored in slots or epochs silently halved on Oct 9, 2026. The shorter blockhash window (150 blocks ≈ 30 s) also pushes cold-signing flows toward durable nonces, the Drift vector. See KV-138, KV-119.
- OPS-086: Governance, upgrade and treasury timelocks, voting periods and hold-up times denominated in slots or epochs (spl-governance stores seconds; custom programs, forks and Realms plugins often store slots) are converted at 200 ms and compared with the written policy, and the effective delay still gives the community the wall-clock reaction window the policy promises. (PASS: seconds, or slot / epoch values doubled at activation with a governance record; FAIL-8: a 432,000-slot "48 h" timelock that is now 24 h, a direct downgrade of the control that would have exposed a hidden-clause proposal.)
- OPS-087: Multisig, hardware-wallet and air-gapped approval flows that cannot sign and land within the ~30 s blockhash lifetime use a protocol-native proposal / transaction buffer (Squads-style, executed on-chain after approval) rather than pre-signed durable-nonce transactions; where durable nonces are used, the KV-119 controls hold (nonce-authority custody, inventory of outstanding pre-signed transactions, execution timelock, signer verification of the full message). (PASS: buffer-based flow, or nonces with those controls; FAIL: the team's answer to the shorter window was "switch to durable nonces" without them, which recreates the pre-signed admin-transaction setup behind the Drift drain ($285M, Apr 2026).)
7.13 — Framework, Build Features & Pre-Signed Approvals
- OPS-088: The IDL surface is governed. Legacy IDL instructions are compiled in on Anchor 0.x unless the
no-idlfeature is active in the deployed build, and on Anchor ≥ 1.1.0 only with#[program(legacy_idl)](#4455). Anchor 1.0.x has none (#3798). Where they exist, the IDL account exists, was created in the deploy flow, and its authority is the same multisig as the upgrade authority. On ≥ 1.0 the Program Metadata authority is recorded. Legacy IDL accounts left over from a 0.x deployment are closed after the move to 1.x (KV-153). <!-- verified: anchor v0.32.1 lang/syn/src/codegen/program/dispatch.rs IDL_IX_TAG dispatch "unless they have `no-idl`"; v1.0.0/v1.0.3 no IDL dispatch; legacy_idl opt-in commit 93a33158 tagged v1.1.0+ (e15e31e7 on v1.2.x) --> - OPS-089: No signer, oracle-staleness, admin or other security check sits behind a cargo feature or
cfg(includingcfg(any(feature..)),cfg_attrandcfg!(feature ..)).defaultfeatures are empty or benign, and the features used by the deployed/verified build are recorded. Grep:rg -n 'cfg(_attr)?!?\(.*feature' programs/*/srcand inspect[features]. - OPS-090: The resolved
anchor-lang/anchor-splversion was checked against the framework advisory matrix (KV-158), and every matching row whose pattern exists in the code is reported. - OPS-091: Privileged actions pre-signed against a durable nonce: the runtime accepts the transaction only if
AdvanceNonceAccountis instruction 0 and the nonce authority signs it. The authority is therefore a transaction-level key; a PDA cannot be it. Once the transaction is fully signed, anyone holding the bytes can submit it until the nonce advances, and only the nonce authority can advance, withdraw or re-authorize the nonce. The authority is always one key, so an outstanding approval can be revoked only by whoever holds that key advancing the nonce. Record who holds each nonce authority. When that holder is a single member, an external party or a relayer, the other signers cannot revoke: FAIL unless an on-chain version/epoch guard, expiry or timelock lets them invalidate the approval (KV-119). <!-- verified: agave v3.0.0 runtime/src/bank/check_transactions.rs nonce_is_authorized = message.get_ix_signers(NONCED_TX_MARKER_IX_INDEX).any(|s| s == &nonce_data.authority) --> - OPS-092: Review the governance red flags (signals, not proof): a timelock removed or shortened on high-privilege paths; a threshold reduction or signer rotation bundled with other admin changes; a security-council/emergency-authority migration just before a high-impact action; signer churn around governance operations; pre-signed admin transactions accepted without fresh confirmation at execution.
- OPS-093: Value-moving programs have a global operating mode (normal / halted / withdraw-only), and every value-moving instruction gates on it deliberately, including cranks and liquidations.
- OPS-094: Setters for terms that govern already-committed funds (lock duration, exit fee, hook, allowlist, pause, oracle source) are monotonic in the user's favour, grandfathered by snapshot, or timelocked (KV-172).
- OPS-095: In upgradeable or unverified programs and their CPI targets, value-moving branches do not depend on signals with no business meaning that could differ between simulation and execution: slot or blockhash parity, fee-payer lamports, the presence of certain sysvars/accounts, remaining compute. Deployed bytecode matches the verified source. (Low-confidence review prompt.)
- OPS-096: Programs that CPI through a
declare_program!client generate it from a reviewed IDL file committed underidls/and pinned to the callee's deployed version. A callee upgrade that changes discriminators, account order or argument layout is caught by review before the caller ships. - OPS-097: Before the upgrade authority is revoked, configuration is frozen in a sane state, a recovery or sweep path exists for every account type, and a singleton init that binds to the upgrade authority has already run (AC-056).
Sources: 0xMacro/awesome-solana-security → Accretion "Hidden IDL Instructions" [paraphrased, cited]; CDSecurity/cdsecurity-skills rust-audit-prep/references/checklist.md (test helpers / cfg(test) leaks) (MIT, Copyright (c) 2026 CD Security); otter-sec/anchor (Apache-2.0); beriktassuly/solana-audit-skill skill/references/taxonomy/durable-nonce-governance.md (MIT, Copyright (c) 2026 Berektassuly); solana-foundation/solana-dev-skill skills/solana-dev/references/programs/design-patterns.md (MIT, Copyright (c) 2026); qedgen/solana-skills skills/qedgen-auditor/references/category-catalog.md custody_terms_retroactive_mutation (MIT, Copyright (c) 2025 QEDGen); sannykim/solsec → Opcodes simulation-detection post [paraphrased, cited, low confidence]; PlamenTSV/plamen agents/skills/solana/migration-analysis/SKILL.md (immutability endgame) (MIT, Copyright (c) 2025-2026 Plamen Contributors).
7.14 — Upgrade & Account-Migration Safety
- OPS-098: Every upgrade that changes an account layout has a written migration plan. Live accounts carry an in-data layout version that has existed since the first deployment, or the layout change renames the type (new discriminator). An Anchor discriminator proves the type, not the layout version.
- OPS-099: Migrations are idempotent and resumable: re-running on an already-migrated account is a no-op or a clean, per-account error that batch tooling filters out. Anchor ≥ 1.0
Migration<'info, From, To>rejects an already-migrated account only because it fails to deserialize asFrom(owner check, thenFrom::try_deserialize). That holds only ifFromandTohave different discriminators (different type names or explicit discriminators) and aToaccount cannot parse asFrom. If they share a discriminator, a migrated account is accepted and migrated again: a finding.AccountAlreadyMigratedis raised only whenmigrate()is called twice on the same in-memory value, andexit()returnsAccountNotMigratedif the handler never migrated the account. - OPS-100: During the mixed-version window, user exits, claims and emergency actions work for both old and migrated accounts: two code paths, or a version-dispatching loader via
UncheckedAccount. A singleAccount<NewLayout>cannot load old, shorter Borsh accounts. - OPS-101: A migration pause/guard can stop a defective migration mid-run, and the upgrade authority is not revoked while a migration is incomplete (that would leave accounts the live program cannot deserialize).
- OPS-102: The previous binary is archived with a ready redeploy path. The rollback plan states that code rollback is not data rollback: once accounts are rewritten, the old binary may not be able to read them.
- OPS-103: Destructive layout changes copy to a new account/PDA rather than reinterpreting in place. The migration is tested against realistic state: mainnet-dumped accounts in LiteSVM/Mollusk, a byte-diff of carried fields, and a negative test on already-migrated accounts.
Sources: beriktassuly/solana-audit-skill skill/references/taxonomy/upgrade-admin-governance.md (MIT, Copyright (c) 2026 Berektassuly); PlamenTSV/plamen agents/skills/solana/migration-analysis/SKILL.md (MIT, Copyright (c) 2025-2026 Plamen Contributors).