Skip to content

Z010: Detect missing access control on verifying-key rotation/upgrade #1206

Description

@Gbangbolaoluwagbemiga

Overview

Implement rule Z010: detect any function capable of writing/rotating the stored verifying key that lacks an admin/auth check, which would let anyone replace the trusted verification parameters and forge acceptance of invalid proofs.

Background / Context

This is the ZK-specific analogue of the existing S010 upgrade-admin rule family, applied specifically to verifying-key storage rather than contract WASM upgrades — a distinct and equally critical attack surface once contracts support VK rotation (as recommended for long-lived ZK systems needing circuit updates).

Goal

sanctifier-core flags any public function that writes to verifying-key storage without a preceding require_auth/admin check, following the same detection pattern already proven for S010.

Scope of Work

  1. Extend the existing S010 upgrade-admin detection pattern to also match verifying-key storage writes.
  2. Add triggering/clean fixtures under z010_missing_vk_rotation_access_control.rs.
  3. Document in docs/rules/Z010.md, cross-referencing S010.

Out of Scope

  • Building the VK-rotation feature itself — detection of missing access control on any such feature, existing or future.

Acceptance Criteria

  • Rule flags an unauthenticated VK-write function and not an authenticated one.
  • Snapshot tests pass.

Files & Pointers

  • tooling/sanctifier-core/src
  • contracts/fixtures/finding-codes/z010_missing_vk_rotation_access_control.rs
  • docs/rules/Z010.md
  • docs/rules/S010.md

Dependencies / Related

Depends on #1192, #1194. Reuses S010 pattern infrastructure.

Difficulty & Estimated Effort

Medium — ~2-3 days (reuses existing S010 detection infra).

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomponent:coretooling/sanctifier-core (analysis engine)difficulty:mediumModerate changenext-waveScoped for the next contributor wavepriority:p0Must do now (blocks CI/release/production)type:featureNew user-facing or platform capabilityzkZero-knowledge proof feature work

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions