docs: add formal threat model for compliance primitives (#112) - #335
Merged
Idaonoli merged 2 commits intoSep 3, 2026
Merged
Conversation
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Formal threat model for
allowlist-token,denylist-gate,jurisdiction-flagSummary
Closes #112
Adds
docs/THREAT_MODEL.md, a formal threat-model document distinct from thepending SPEC.md (#29). It enumerates and analyses attack scenarios for the
three compliance-critical contracts along the three axes the issue requires:
run up resource fees, and whether any function lets a non-admin write storage.
add_to_allowlistvstransfer(anddenylist/jurisdiction vs gated-action) ordering question within a ledger close.
and how quickly damage is bounded given two-step admin transfer (Implement a two-step admin transfer (propose/accept) for allowlist-token #74/Implement a two-step admin transfer (propose/accept) for denylist-gate #75/Implement a two-step issuer transfer (propose/accept) for jurisdiction-flag #76)
and pause (Add a pausable trait to denylist-gate (admin can pause add/remove, not check) #84/Add a pausable trait to jurisdiction-flag (issuer can pause set_jurisdiction) #85) once they land.
Coverage vs acceptance criteria
docs/THREAT_MODEL.mdcovering griefing, front-running, andadmin-key-compromise for
allowlist-token,denylist-gate, andjurisdiction-flagindividually (sections 1–3).an existing mitigation (a function such as
pause/unpause,propose_admin/accept_admin,multisigsigners, orupgrade) or a pending issue number(Implement a two-step admin transfer (propose/accept) for allowlist-token #74/Implement a two-step admin transfer (propose/accept) for denylist-gate #75/Implement a two-step issuer transfer (propose/accept) for jurisdiction-flag #76 two-step admin, Add a pausable trait to denylist-gate (admin can pause add/remove, not check) #84/Add a pausable trait to jurisdiction-flag (issuer can pause set_jurisdiction) #85 pause, Add upgradeability pattern (contract migration path) to allowlist-token #113 upgradeability) where the
mitigation has not yet landed.
issue), and noted explicitly at the bottom of the doc.
Key findings surfaced
storage-fill griefing class does not apply (verified by reading each
lib.rs— every write entry point requires
admin/issuer/compliance_officer).(
check,is_permitted_jurisdiction) are evaluated separately from thegated action, leaving a one-ledger window. Recommended an in-transaction hook.
jurisdiction-flag::upgradeis 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.
add_to_denylistdeclaration indenylist-gate(
lib.rs:161andlib.rs:189) as a follow-up (potential compile error).Verification
Documentation-only change; no code modified, builds unaffected.
closes #112