Skip to content

docs: add formal threat model for compliance primitives (#112) - #335

Merged
Idaonoli merged 2 commits into
stellar-compliance-kit:mainfrom
gabrielujelistic-collab:docs/issue-112-threat-model
Sep 3, 2026
Merged

docs: add formal threat model for compliance primitives (#112)#335
Idaonoli merged 2 commits into
stellar-compliance-kit:mainfrom
gabrielujelistic-collab:docs/issue-112-threat-model

Conversation

@gabrielujelistic-collab

Copy link
Copy Markdown
Contributor

Formal threat model for allowlist-token, denylist-gate, jurisdiction-flag

Summary

Closes #112

Adds docs/THREAT_MODEL.md, a formal threat-model document distinct from the
pending SPEC.md (#29). It enumerates and analyses attack scenarios for the
three compliance-critical contracts along the three axes the issue requires:

Coverage vs acceptance criteria

Key findings surfaced

  1. No non-admin storage writes exist in any of the three contracts, so the
    storage-fill griefing class does not apply (verified by reading each lib.rs
    — every write entry point requires admin/issuer/compliance_officer).
  2. Front-running / TOCTOU is the highest real risk: the read gates
    (check, is_permitted_jurisdiction) are evaluated separately from the
    gated action, leaving a one-ledger window. Recommended an in-transaction hook.
  3. jurisdiction-flag::upgrade is issuer-only with no multisig/timelock
    a single-point-of-catastrophe key (scenario J6, rated Critical). This directly
    motivates Add upgradeability pattern (contract migration path) to allowlist-token #113's upgradeability pattern.
  4. Noted a possible duplicate add_to_denylist declaration in denylist-gate
    (lib.rs:161 and lib.rs:189) as a follow-up (potential compile error).

Verification

Documentation-only change; no code modified, builds unaffected.

closes #112

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

@Idaonoli is attempting to deploy a commit to the idaonoli-2655's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Idaonoli
Idaonoli merged commit df9c51e into stellar-compliance-kit:main Sep 3, 2026
1 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a formal threat model document covering griefing, front-running, and admin-key-compromise scenarios for each contract

2 participants