WASM-PROVENANCE.md

2.7 KB · raw

rendered · source

WASM & Crypto-Adjacent Dependency Provenance

<!-- DESTINATION: repo root. Drafted under PCH-02-004 because the file the LV-9 session referenced was never committed. -->

Peach's vault security rests on a small set of third-party packages that either ship WebAssembly blobs or sit directly on a security path. This file records what each one is for and the supply-chain rules that apply to them.

Exact-pin discipline (LV-9, extended by PCH-02-004)

Every dependency listed below is exact-pinned in package.json (no caret or tilde ranges) and locked in bun.lock with packageManager pinned to a specific bun release. CI installs with a frozen lockfile (LV-6). Upgrading any of them is a deliberate act: bump the pin, regenerate the lockfile, and re-run the full suite — never a side effect of a fresh resolve.

WASM-shipping packages

Package Pinned Role
hash-wasm 4.12.0 Argon2id (master-password KDF) and BLAKE3 (payload checksums, vault id)
@bokuweb/zstd-wasm 0.0.27 zstd compression inside the encrypted export envelope
@subspace/reed-solomon-erasure.wasm 0.2.5 Codex paper-backup erasure coding

Pure-JS crypto core

Package Pinned Role
@stablelib/* (blake2s, chacha20poly1305, hkdf, hmac, sha256, x25519) 2.0.1 Noise NK handshakes and transport encryption for sync
@zxcvbn-ts/* 3.0.4 / 3.0.2 Password strength estimation
tldts 7.0.28 eTLD+1 derivation for the autofill origin boundary
pdfjs-dist 5.7.284 Codex PDF import (hardened per MV-9)

Crypto-adjacent (exact-pinned by PCH-02-004)

These do not hold key material but feed or transform security-relevant data, so the same pin discipline applies:

Package Pinned Role
otpauth 9.5.0 TOTP code generation (RFC 6238) from stored seeds
pako 2.1.0 Codex restore-side decompression (bomb-capped per MV-4)
@zxing/library 0.23.0 Aztec matrix decode on Codex restore
bwip-js 4.11.1 Aztec matrix encode on Codex generation
pdf-lib 1.17.1 Codex PDF assembly (note: bundles its own internal [email protected], distinct from the import-side [email protected])
papaparse 5.5.3 CSV import parsing (formula-injection surface)

Verifying a WASM blob

The WASM packages ship compiled binaries; their provenance chain is npm-registry integrity hash → bun.lock → frozen-lockfile CI. When bumping one, diff the package's published source repository tag against the shipped artifact where the upstream provides reproducible builds, and re-run the unlock-time Known-Answer self-test (src/background/self-test.ts) plus the Argon2id KAT (src/crypto/argon2id.kat.test.ts) — a silently-swapped KDF or hash implementation fails those vectors.