Skip to content

Reject stale authorization nonces on admin actions #1223

Description

@mikewheeleer

Summary

Signed administrative operations can be replayed if nonce consumption is not atomic and scoped.

Why this matters

This closes a correctness, security, or operability gap in the Liquifact Soroban contracts and makes the behavior explicit under authorization, replay, and storage failure.

Requirements

  • Repository scope: Liquifact/Liquifact-contracts only.
  • Persist a monotonic admin nonce; consume it with the state change; return a typed stale-nonce error without leaking signatures.
  • Preserve storage compatibility, append-only error semantics, authorization boundaries, and event behavior unless this issue explicitly changes them.
  • Add focused unit and integration coverage for the new behavior.

Technical guidance

  • Follow the existing DataKey, storage TTL, auth, event, and typed-error conventions in the repository.
  • Keep state changes atomic, bounded, and safe under retries or concurrent invocations.
  • Document non-obvious security assumptions and include test evidence in the PR.

Edge cases — each must have a test

  • next nonce
  • old nonce
  • future nonce
  • two same-nonce calls
  • nonce near maximum

Acceptance criteria

  • Every requirement and edge case above is implemented and tested
  • Unit and integration tests cover success, failure, authorization, replay, and boundary paths
  • Existing tests pass with no regressions
  • Errors are structured, stable, and do not leak internal details
  • cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings, and cargo test passes locally
  • Code follows existing conventions with no duplication or dead code
  • Documentation or concise Rustdoc comments explain non-obvious decisions
  • PR description explains the approach, includes test evidence and security notes, and references Closes #

Out of scope

  • multi-signature policy design

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveStellar Wave Program task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions