Threat Model and Security Claims¶
Status: Living document, written for the 4.0.0 external audit. It describes the
feat/v4-productbranch including the fixes of the blind review (RFC-0035). It is the maintainers’ model, not an independent assessment.Owner: Security owner.
Last updated: 2026-12-01
Related: the format and its security considerations (envelope-format.md section 11), the internal audit (RFC-0031), and the audit scope (audit-scope.md).
Every claim below names the mechanism that provides it and the tests that would fail if it stopped holding. A claim without both is not made.
1. Assets¶
Asset |
Where it lives |
What must hold |
|---|---|---|
Plaintext |
Caller memory; an uncommitted sink while a stream is read. |
Confidentiality, integrity. |
Data key (DEK) and the keys derived from it |
SDK memory; the DEK also exists wrapped in each recipient. |
Confidentiality. The DEK reaches a provider only to be wrapped or unwrapped; derived keys never leave the SDK. |
Wrapping keys |
A key service (AWS KMS, Google Cloud KMS, Azure Key Vault or Managed HSM, Vault Transit); HPKE and custodian private keys held by their owners. |
Confidentiality and controlled use. The SDK never holds service keys. |
Encryption context |
The caller. The envelope stores only a commitment keyed from the DEK. |
Integrity binding; confidentiality from envelope holders. |
Envelope metadata |
The protected header and recipient section. |
Integrity. It is visible by design (section 5). |
Audit trail |
The application’s audit storage. |
Integrity and detectable truncation. |
Audit signing key |
The application. |
Confidentiality. |
Release artifacts |
PyPI and GitHub releases. |
Provenance: built from reviewed source by the release workflow. |
v3 files and their passwords |
The caller, during a migration (RFC-0033). |
The plaintext reaches only the new envelope; the password reaches only the key derivation. |
v3 keys and key stores |
The caller’s v3 directories (RFC-0034). |
No key is exported; a private key reaches only the caller’s HPKE provider, and an inventory decrypts nothing. |
2. Adversaries¶
ID |
Adversary |
Capabilities assumed |
|---|---|---|
A1 |
Storage or network attacker |
Reads, changes, truncates, extends, reorders, replays, and splices envelope bytes, including bytes of other envelopes and tenants, and crafts envelopes from nothing. |
A2 |
Holder of a key the reader does not trust |
Controls a wrapping key that the reader’s credentials or provider can also use: a KMS key in another account whose key policy grants the reader decrypt, another tenant’s branch key, or an HPKE identity loaded for another purpose. |
A3 |
Sealer-only service |
Holds public keys or wrap-only permission and tries to open. |
A4 |
Recipient insider |
Holds one recipient key of an envelope and may act as a malicious sender to its other recipients. |
A5 |
Dishonest custodians |
Fewer than the threshold collude, or one releases a wrong share. |
A6 |
Co-tenant |
Writes to a shared hierarchical branch-key store. |
A7 |
Local unprivileged user |
Races paths in an output directory with links, renames, and reparse points. |
A8 |
Observer |
Reads errors, exception text, logs, audit events, metrics, and terminal output. |
A9 |
Slow or failing key service |
Not malicious: latency, throttling, errors, partitions. |
A10 |
Supply-chain attacker |
Tampers with a dependency, a workflow, or a release artifact. |
A11 |
Future quantum adversary |
Records ciphertext today, to decrypt it later. |
3. Trust boundaries¶
ID |
Boundary |
Rule |
|---|---|---|
B1 |
Envelope bytes to the codec |
Untrusted. Every length is checked against policy limits and hard ceilings before it is read. |
B2 |
|
A configured provider is trusted to wrap and unwrap correctly and to bind its wrap to the protected bytes. It receives the DEK and the protected bytes, never the context, a derived key, or plaintext. Every call carries an operation deadline. |
B3 |
Provider to its cloud SDK |
SDK defaults are untrusted: retries and timeouts are set by the provider wherever the SDK allows it per call (F-9, F-10). |
B4 |
Other untrusted input |
Branch-key store records, quorum share requests and releases, COSE messages and keys, audit records, the CLI’s configuration and arguments. Each has a strict, bounded parser. |
B5 |
SDK to the filesystem |
Other local users may race the output path. |
B6 |
SDK to observers |
Errors, audit events, metrics, and CLI output are public. |
B7 |
Source to release |
Only the release workflow publishes, from a tag, through OIDC. |
B8 |
v3 file to a legacy adapter |
Untrusted, like B1: the format and key derivation are declared, never detected, and every header field, length, and KDF parameter is bounded. Key files and key-store entries are identified by structure, bounded before decryption, read without following links, and quarantined when they cannot be trusted. |
4. Claims¶
Envelopes¶
ID |
Claim |
Mechanism |
Evidence |
|---|---|---|---|
C-1 |
Without a trusted recipient key, an envelope reveals nothing about its plaintext beyond the metadata in section 5. |
AES-256-GCM under a 256-bit key that HKDF-SHA-512 derives from a fresh 256-bit DEK and a fresh 256-bit |
|
C-2 |
Any change to an envelope is refused by |
STREAM nonces and record AAD with the index, the final flag, and the header digest; the recipient-manifest MAC; the key commitment. |
|
C-3 |
An envelope opens only through a key the reader configured. A recipient that names any other key never reaches a provider. The independent JavaScript reader keeps the same rule. |
Trusted keys: recipient keys plus |
|
C-4 |
Every recipient that opens an envelope recovers the same DEK, so a sender cannot show different plaintexts to different recipients. |
A 256-bit key commitment, compared in constant time before any other derived key is used. |
|
C-5 |
An envelope opens only with the context it was sealed with. Envelope holders without the DEK cannot test guesses of the context. |
HMAC-SHA-256 commitment keyed from the DEK; the context is never stored. |
|
C-6 |
A wrapped DEK cannot be moved into another envelope. |
Each provider binds its wrap to the protected bytes: an AWS encryption context, Google Cloud KMS additional authenticated data (and the KEM |
|
C-7 |
A service that holds only public keys can seal but not open. |
HPKE recipients registered by public key have no unwrap capability. |
|
C-8 |
No unauthenticated plaintext is released. |
|
|
C-9 |
|
Spec section 8.5. |
|
C-10 |
|
Spec section 8.4. Spec section 8.4 rule 3 (RFC-0035 CORE-5). |
|
Untrusted input and availability¶
ID |
Claim |
Mechanism |
Evidence |
|---|---|---|---|
C-11 |
Parsers of untrusted input return the original or raise only their documented errors, within the policy’s limits. Fuzzed or exhaustively mutated: every envelope reader, the COSE message and key decoders, key text and PEM, policy documents, contexts, audit-chain verification, and the CLI. Branch-key records and quorum messages are strictly parsed and tested at each bound. |
Lengths checked before reads; hard ceilings (spec section 9); strict CBOR and JSON. |
|
C-12 |
One envelope causes at most one unwrap call per distinct trusted key version. Provider calls respect a per-operation deadline and a bounded number of attempts. Google Cloud and Azure calls carry the time left as their timeout and make no SDK retries; AWS clients must make one attempt per call. Untried candidates share the time left, so a key service that hangs until the deadline cannot starve an escrow recipient. |
Trusted-key selection (F-5); |
|
Recovery, tenancy, and audit¶
ID |
Claim |
Mechanism |
Evidence |
|---|---|---|---|
C-13 |
Fewer than the threshold of custodians cannot recover a quorum-protected DEK. A share is bound to its envelope, quorum version, and position. One wrong release cannot block recovery once enough honest releases arrive, and it is identified. No custodian private key leaves its owner. A custodian releases only to the coordinator whose fingerprint they were given out of band, and only a custodian can answer their own request, so an altered or forged message neither collects a share nor overwrites one, and no absent custodian is blamed. |
Shamir sharing over GF(2^8); HPKE per share; an integrity tag keyed from the DEK; a search over release combinations; releases re-encrypted to an ephemeral coordinator key. The ceremony fingerprint and per-request tokens with release MACs (RFC-0035 PROV-2, PROV-3). |
|
C-14 |
A branch-key store is untrusted for integrity: a record that is altered, relabelled, or taken from another tenant is refused. The branch-key cache is bounded by age, uses, and size. A record is used only if the configured root key wrapped it. |
Branch keys are wrapped by the root key and bound to their branch identifier and version. Root-key pinning on every branch-key unwrap (RFC-0035 PROV-1). |
|
C-15 |
Changing, reordering, or deleting an audit record, and truncating the trail after a checkpoint, are detected by verification. |
Canonical JSON records, hash-chained and signed with Ed25519 or ML-DSA-65; checkpoints. |
|
Migration from version 3¶
ID |
Claim |
Mechanism |
Tests |
|---|---|---|---|
C-22 |
A migration publishes an envelope only when the whole v3 input authenticated under its GCM tag and an independent reopening of the new envelope produced the same plaintext. On any failure, cancellation included, nothing is published, no plaintext is written, and the source is unchanged. Nothing is published before a required audit event is recorded, and the permission is checked again at publication. |
The legacy tag is checked at the end of the stream; a second thread reopens the envelope through |
|
C-23 |
A v3 file is read only as the format and key derivation that the policy and the caller name: nothing is detected, a |
|
|
C-24 |
v3 key material is never exported. An inventory decrypts no key and never reads a stored password. An import accepts only an X25519 or P-384 key that the policy permits, an unencrypted private key only under |
Structure identified from the PEM label or DER shape; PBES2 parameters read first; the HPKE provider as the only destination (RFC-0034). The algorithm identifier is read first; RSA loads without OpenSSL’s consistency check (RFC-0035 MIG-1). |
|
Observability, local system, and interfaces¶
ID |
Claim |
Mechanism |
Evidence |
|---|---|---|---|
C-16 |
Errors, |
Typed errors with redaction (RFC-0004); secret-free audit events. |
|
C-17 |
Output files are published atomically, without replacing an existing file. No path component is followed through a symbolic link or reparse point. Temporaries are mode 0600 from creation. A failure leaves nothing at the destination, and the input is never overwritten. On Windows, no held parent directory can be renamed while the sink holds it. The status file is published the same way. |
Directory-descriptor-relative operations with |
|
C-18 |
The CLI reads secrets only from a file descriptor or stdin, never from arguments or the environment, and escapes non-printing characters of unauthenticated envelope text before printing it. JSON status escapes every non-ASCII character, so control and format characters reach a terminal only as escapes. |
RFC-0015; RFC-0031 F-6. ASCII JSON (RFC-0035 SYS-3, SYS-5). |
|
C-19 |
Hybrid recipients stay confidential while either ML-KEM or the classical component is unbroken. |
HPKE with X-Wing (ML-KEM-768 + X25519) or ML-KEM-1024 + P-384 (RFC-0017). |
|
C-20 |
COSE-HPKE messages are produced and read exactly as draft-ietf-cose-hpke-27 and RFC 9180 define them. |
RFC-0030. |
|
C-21 |
A release is built once from a |
Actions pinned to full commit SHAs, per-job permissions, OIDC, build provenance and PEP 740 attestations, a reproducible build. |
|
5. Not claimed¶
These are outside the model. Each is a deliberate limit, documented where users will read it.
Sender authentication. Envelopes and COSE-HPKE messages authenticate the recipient, not the sender: anyone who can wrap to a recipient key can seal to it. Sign the envelope when its origin matters.
Non-repudiation among recipients. Any recipient can unwrap the DEK and then seal new data that the other recipients accept (spec section 11).
A malicious provider or key service. A configured provider is trusted to use the key it names and to bind its wrap (B2).
Metadata confidentiality. Provider, key identifier and version, recipient count, chunk size, one-shot plaintext length, record count, and an optional creation time are visible.
Records outside a range.
open_rangedoes not verify them (C-9); useopento verify a whole envelope.Memory hygiene. Python cannot guarantee that secrets are erased. The SDK overwrites the buffers it owns, as a best effort.
Side channels beyond those named. Commitment, MAC, and binding comparisons are constant time; pyca/cryptography provides the primitives. The quorum’s GF(2^8) arithmetic uses table lookups and runs only when sealing and recovering.
A compromised host or a compromised caller. Code in the same process can read every secret the SDK holds.
Availability of the key service (A9). The SDK bounds its own waiting and retries; it cannot make an unavailable service available. Escrow and quorum recipients exist for that disaster.
Classical recipients against A11. Only hybrid recipients resist a future quantum adversary.
FIPS validation.
Policy.fips()restricts algorithms; no validation or certification is claimed.v3 keys exposed before migration. A key that 3.0.0 stored with its password beside it (RFC-0034 K-1), or stored unencrypted, may already be known to anyone who could read the directory. The inventory reports it; only replacing the key ends the exposure.
The strength of v3 data. A migrated file is no stronger than its v3 password and key derivation were, and a
csf-v1header was never authenticated (the receipt records a warning). Migration ends the exposure going forward; it cannot undo an earlier one.
6. Residual risks¶
RFC-0031 and RFC-0035 list them with their mitigations, and the risk register gives each an owner and a review date. In short:
Alias re-pointing is honoured for up to five minutes of cached resolution.
boto3 and hvac set timeouts per client, so the deadline cannot cut an AWS or Vault call short; their READMEs set client timeouts inside it.
No independent audit has been completed; audit-scope.md proposes one. The blind review of RFC-0035 is internal.
RFC-0035 adds: opening costs time linear in an envelope’s record count, bounded by the policy’s plaintext limits; Cloud KMS does not enforce a version pin for symmetric keys; a party that can both wrap under a hierarchical root key and write to its store can plant a branch key; two processes that overwrite the same file at the same moment can both succeed (SYS-7; within one process the second fails); and the release relies on repository settings an owner must apply.