Reference

Rules

Release v0.1.1View Markdown

Rules are grouped by selection category, then by topic for other opt-ins. Each line gives severity, selection and a description, with a link to its documentation at v0.1.1.

All built-in rules are experimental. Severity is review priority, not a probability or a confirmed impact. Intentional behavior can match. Read each rule's evidence, benign matches and limits.

The implicit audit profile selects ordinary audit rules and dormant policy rules. --profile hygiene adds source hygiene. --detectors ID,ID replaces profile selection with an exact nonempty set. Policy rules need matching application intent even when selected. Topic headings are not CLI selection shortcuts.

Audit-default ordinary rules#

24 rules. Run on every ordinary scan.

  • Caller-supplied time satisfies a ledger-derived delay without a chain-time upper bound.

    Audit defaultconfidence: medium

  • Expanded source-operation estimate exceeds the review threshold; this is not a proof-row estimate.

    Audit defaultconfidence: high

  • A comparison not reduced to a source constant is discarded or kept only by unused immutable aliases.

    Audit defaultconfidence: high

  • Canonical shielded send or mint metadata is discarded or retained only by unused immutable aliases.

    Audit defaultconfidence: varies

  • Identical canonical shielded mint inputs produce a duplicate coin commitment in one transaction.

    Audit defaultconfidence: variesverified example

  • Terminating branch repeats its immediate following expression and return tail.

    Audit defaultconfidence: high

  • A native Either's known inactive arm reaches an output, state effect or successful effect gate.

    Audit defaultconfidence: high

  • Enforced Field recomposition retains quotient/remainder envelopes beyond the modulus.

    Audit defaultconfidence: high

  • Caller-supplied time reaches a security-sensitive effect without a canonical block-time freshness bound.

    Audit defaultconfidence: mediumverified example

  • A successful history passes a known identity point to the pinned Schnorr verifier.

    Audit defaultconfidence: high

  • A canonical signature verifier's Boolean outcome is discarded or retained only by unused local aliases.

    Audit defaultconfidence: highverified example

  • A nonliteral assertion fails on every reaching path, or an entry has no successful path.

    Audit defaultconfidence: high

  • A private preimage checked against a ledger hash is also published on a potential successful path.

    Audit defaultconfidence: mediumverified example

  • A published direct hash has one private input drawn from a small declared domain.

    Audit defaultconfidence: high

  • Checked Merkle path leaves lack binding to supplied lookup inputs or exact Field hash write candidates.

    Audit defaultconfidence: varies

  • Proof-related state changes lack an enforced relationship between the exact digest and trusted ledger roots.

    Audit defaultconfidence: lowverified example

  • An authenticated ShieldedAccessControl instance initializes but has no role-seeding route.

    Audit defaultconfidence: varies

  • A published private-derived commitment uses statically known randomness.

    Audit defaultconfidence: highverified example

  • A raw native ownPublicKey selects a required member of preexisting public ledger storage before successful state-changing effects.

    Audit defaultconfidence: high

  • A published digest determines the scalar of a registered curve point through resolved native calls.

    Audit defaultconfidence: varies

  • Both branch arms only return opposite Boolean literals.

    Audit defaultconfidence: high

  • Exact self-addressed canonical returned coin is subsequently passed to receiveShielded.

    Audit defaultconfidence: high

  • A raw witness equality with public data is required for a state-changing effect; review the intended authentication.

    Audit defaultconfidence: variesverified example

  • Review exact surviving Set absence consumption before a zero-inclusive canonical unshielded payout.

    Audit defaultconfidence: varies

Additional hygiene rules#

7 rules. Added by --profile hygiene.

  • Assertion is already true on every analyzed reach before enforcing it.

    Hygiene onlyconfidence: high

  • Branch condition reduces to a typed scalar source constant.

    Hygiene onlyconfidence: high

  • Statement, branch or loop is excluded by source control flow.

    Hygiene onlyconfidence: high

  • Parameter or local binding hides an outer declaration.

    Hygiene onlyconfidence: high

  • A successful circuit uses a protocol block-time comparison.

    Hygiene onlyconfidence: high

  • Disclosure operand is already public in the source context.

    Hygiene onlyconfidence: high

  • Ledger, witness or private circuit has no reference in the compilation unit.

    Hygiene onlyconfidence: high

Policy-dependent rules#

13 rules. Need application intent declared in policies.

  • A checkpoint splits a declared ordinary Cell co-update across atomic units.

    Opt-in + policyconfidence: highneeds policy intent

  • Expanded source-operation estimate exceeds an explicit circuit work budget.

    Audit; needs policyconfidence: highneeds policy intent

  • An explicitly selected membership guard lacks current-root evidence at enforcement time.

    Opt-in + policyconfidence: mediumneeds policy intent

  • Policy-declared secret information reaches a public sink through an unapproved transformation.

    Audit; needs policyconfidence: mediumneeds policy intent

  • A scalar state write may cross a transition explicitly forbidden by policy.

    Audit; needs policyconfidence: mediumneeds policy intent

  • Opt-in documented preconditions of authenticated OpenZeppelin Compact modules.

    Configured builtinsconfidence: highneeds policy intent

  • A protected Cell mutation does not satisfy its declared complete operation-intent statement.

    Opt-in + policyconfidence: highneeds policy intent

  • An explicitly documented configured Map getter returns only default without reading the selected Map.

    Opt-in + policyconfidence: variesneeds policy intent

  • Review an explicit adjacent source claim paired with shielded issuance to a user key.

    Opt-in + policyconfidence: variesneeds policy intent

  • Policy-selected current NFT metadata retains an old auxiliary payload across same-history burn/remint.

    Opt-in + policyconfidence: variesneeds policy intent

  • A successful path writes policy-protected state without the configured preceding guard.

    Audit; needs policyconfidence: mediumneeds policy intent

  • A declared callable pinned Ownable instance finishes with a contract-address owner rejected by its guard.

    Opt-in + policyconfidence: highneeds policy intent

  • Under a declared zero-amount policy, every modeled successful invocation requires the same Map entry to have been present initially.

    Opt-in + policyconfidence: lowneeds policy intent

Other active opt-ins#

52 rules. Select them explicitly with --detectors or the detectors list.

Time and freshness

  • Review an effect-bearing caller value checked against a ledger bound without a same-branch exact clock constraint; time intent unknown.

    Opt-inconfidence: medium

  • A definite native shielded output exceeds the expressly assumed runtime coin encoding range.

    Opt-inconfidence: low

Authorization, identity and membership

  • Review a surviving zero numeric Map insertion at a direct caller key without required initial same-key membership.

    Opt-inconfidence: high

  • A represented constructor history contradicts distinct Set memberships under a complete source closure without subsequent writers.

    Opt-inconfidence: varies

  • Immediate post-constructor collection capacity contradicts required distinct memberships.

    Opt-inconfidence: high

  • Review unknown persistent Schnorr keys without modeled identity rejection.

    Opt-inconfidence: varies

  • Keyed mutation digest/key equality and required Set membership use independent witness snapshots.

    Opt-inconfidence: varies

  • Canonical prover-supplied ownPublicKey participates in a required ledger credential check.

    Opt-inconfidence: high

  • Adjacent signer inequalities omit non-adjacent pairs in a verified threshold claim vector.

    Opt-inconfidence: high

  • Review unknown native signature keys without modeled exact identity exclusion.

    Opt-inconfidence: varies

  • Ledger-bound witness digest and mutation operand use independently supplied witness snapshots without mandatory equality binding.

    Opt-inconfidence: high

  • Review stored supplied Schnorr keys with enrollment and enforced canonical use lacking modeled identity rejection.

    Opt-inconfidence: varies

  • Review explicit absent-to-zero getter evidence alongside an all-zero-success initial-membership Map decrement.

    Opt-inconfidence: high

Privacy and cryptographic derivations

  • A full canonical hash is range-checked by a Uint cast on its source route to a ledger write or exported return.

    Opt-inconfidence: high

  • Conditional unsigned subtraction reaches a fixed-width native persistent-hash input without a qualified inactive-case range invariant.

    Opt-inconfidence: low

  • Shared generic optional witness dispatch has incompatible mandatory bigint/byte-array payload guards; profile-specific compatibility review.

    Opt-inconfidence: low

  • Review a public two-input native digest lacking represented self binding and component default exclusion.

    Opt-inconfidence: high

  • Published exact digest determines a scalar used in native generator multiplication whose result survives in a ledger Cell.

    Opt-inconfidence: high

  • Same-key ledger writers enforce different domain-qualified secret-binding declaration families.

    Opt-inconfidence: varies

  • Terminal ledger data is constructed using an upgrade-unstable transient hash or commitment.

    Opt-inconfidence: low

  • A raw witness leaf reaches surviving ledger state without a modeled assertion using that leaf.

    Opt-inconfidence: variesverified example

  • Review direct witness-derived canonical-send recipients without an exact prior ledger equality binding.

    Opt-inconfidence: varies

Token, coin and value transfers

  • Canonical shielded coin descriptor fields have an unchanged source route to an exported result.

    Opt-inconfidence: varies

  • Permissionless mint and egress compose around a stored-value boundary without a modeled authorization predicate.

    Opt-inconfidence: high

  • Received shielded coin lacks a recorded application constraint on color or value.

    Opt-inconfidence: low

  • An exported amount is forwarded unchanged to a canonical shielded burn whose coin and API amount types are wider.

    Opt-inconfidence: high

  • Review canonical shielded sends with a modeled non-self ContractAddress recipient arm.

    Opt-inconfidence: varies

  • Review ordinary state or shielded input coin sources absent from enforced signature message dependencies.

    Opt-inconfidence: varies

  • A variable mint amount has no modeled per-call cap below the native range or public ledger bound.

    Opt-inconfidence: varies

  • Successful token operations have no required application predicate constraining private caller inputs.

    Opt-inconfidence: low

  • Review a complete local refund-validator endpoint producing a zero remainder send expression.

    Opt-inconfidence: varies

  • Review exact same-color complementary sends with two zero-inclusive amount envelopes.

    Opt-inconfidence: varies

  • Review an amount-zero successful numeric Map debit whose exact lookup has unknown prior membership.

    Opt-inconfidence: high

  • Review canonical unshielded send amounts with a zero-inclusive successful-history range.

    Opt-inconfidence: varies

  • Review zero-inclusive actual transfers paired with retained List append for the exact user recipient.

    Opt-inconfidence: varies

State and collections

  • An unchanged caller input must equal preexisting public ledger bytes before a state-changing effect.

    Opt-inconfidence: medium

  • Whole-list reset lacks a recognized same-revision count, empty-list or absent-slot acknowledgment.

    Opt-inconfidence: varies

  • Consumer co-membership is checked on only some successful histories of a keyed insert.

    Opt-inconfidence: high

  • Terminal payout remains reachable after a mutually exclusive one-time milestone.

    Opt-inconfidence: high

  • Opt-in review of initializer-named entries with a state-changing second invocation.

    Opt-inconfidence: lowverified example

  • Canonical shielded coin nonce derives solely from a selected ledger List length that another exported entry can reset.

    Opt-inconfidence: high

  • Stored recipient List payload and canonical coin nonce both evolve from the same resettable selected List extent.

    Opt-inconfidence: high

  • Distinct importing module wrappers expose one canonical false-guard then true-write Boolean gate.

    Opt-inconfidence: high

  • Ordinary ledger Cell is explicitly written but has no Compact source read in the compilation unit.

    Opt-inconfidence: high

Source structure and validation

  • A successful value output or pinned Ownable update uses a known default active address.

    Opt-inconfidence: high

  • A threshold-only assertion uses the exact unshielded balance getter instead of its comparison API.

    Opt-inconfidence: high

  • A directly published Field operation on preserved unsigned quantities may wrap without a proved bound.

    Opt-inconfidence: varies

  • An exported writer omits the caller-check convention required by a strict majority of its peers.

    Opt-inconfidence: low

  • Review sequential bounded Merkle insertion without exact surviving duplicate prevention.

    Opt-inconfidence: medium

  • Required collection absence lacks a definite surviving insertion on a state-changing history.

    Opt-inconfidence: lowverified example

  • A supplied tag is required equal to a hash derived from preexisting public ledger data and caller-supplied inputs before an effect.

    Opt-inconfidence: medium

  • Review predicate outcomes discarded before effects, persisted, or returned with an effect; security intent unknown.

    Opt-inconfidence: varies

Inspect the installed rules#

Using the installation from getting started:

Shell
./.nightshade/node_modules/.bin/nightshade detector list
./.nightshade/node_modules/.bin/nightshade detector show ledger-bound-preimage-publication