Skip to content

Commit 1edd5e2

Browse files
committed
Pre-release fixes: restore FIPS 140 disclaimer, add WASM patch failure warning, sync threat tables
Restored the FIPS 140-2/3 validation disclaimer in README and SECURITY-MODEL.md (lost during earlier README rewrite). Added build-time warning to patch-wasm.cjs when the WASM integrity pattern isn't matched. Updated SECURITY.md threat table to include the Runtime WASM check column, matching SECURITY-MODEL.md. Added quantum-safe-wallet example to CHANGELOG 1.0.0 entry.
1 parent aa2a0e0 commit 1edd5e2

6 files changed

Lines changed: 22 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ temp/
157157
# Documentation build
158158
# -----------------------------------------------------------------------------
159159
docs/_build/
160+
docs/superpowers/
160161
site/
161162

162163
# -----------------------------------------------------------------------------

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- Runtime WASM integrity check: SHA-256 hash of the WASM binary is embedded in the Node.js loader at build time and verified before instantiation, blocking tampered binaries from executing
1515
- Tests for the runtime integrity check (embedded hash correctness and tamper detection)
16+
- `examples/quantum-safe-wallet.mjs`: end-to-end cryptocurrency wallet simulation demonstrating ML-DSA signature replacement with address-to-key binding validation
1617

1718
### Changed
1819

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ High-performance post-quantum cryptography for JavaScript and TypeScript, powere
1212
[![FIPS 205](https://img.shields.io/badge/FIPS%20205-SLH--DSA-blue)](https://csrc.nist.gov/pubs/fips/205/final)
1313
[![provenance](https://img.shields.io/badge/provenance-sigstore-green)](https://www.npmjs.com/package/fips-crypto)
1414

15+
> **Note:** This package implements the algorithm specifications in FIPS 203, FIPS 204, and FIPS 205. It is **not** a FIPS 140-2 or FIPS 140-3 validated cryptographic module. If your compliance framework requires CMVP-validated modules, this library does not satisfy that requirement.
16+
1517
## Why post-quantum cryptography matters
1618

1719
Quantum computers running Shor's algorithm will break the classical cryptography that secures today's systems:

SECURITY.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ A successful result confirms the package was built and published by the GitHub A
7878

7979
### What each verification layer protects against
8080

81-
| Threat | Checksums | Provenance |
82-
|--------|-----------|------------|
83-
| CDN/mirror corruption | Yes | No |
84-
| Stolen npm token | No | Yes |
85-
| Compromised CI environment | No | No |
81+
| Threat | Runtime WASM check | Checksums | Provenance |
82+
|--------|--------------------|-----------|------------|
83+
| WASM binary tampered post-install | Yes | Yes | No |
84+
| CDN/mirror corruption | Yes | Yes | No |
85+
| Stolen npm token | No | No | Yes |
86+
| Compromised CI environment | No | No | No |
8687

8788
For a detailed security model, see [docs/SECURITY-MODEL.md](docs/SECURITY-MODEL.md#checksums-vs-provenance-threat-boundaries).

docs/SECURITY-MODEL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Security Model
22

3+
> **Compliance scope:** fips-crypto implements the cryptographic algorithms specified in FIPS 203 (ML-KEM), FIPS 204 (ML-DSA), and FIPS 205 (SLH-DSA). It has not undergone FIPS 140-2 or FIPS 140-3 CMVP validation. The "FIPS" in the package name refers to the algorithm standards implemented, not to module-level validation status.
4+
35
This document describes what fips-crypto protects against, how, and what it does not guarantee.
46

57
## Quantum Threat Context

scripts/patch-wasm.cjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ if (fs.existsSync(wasmBinaryPath)) {
8484
.map(f => path.join(NODE_WASM_DIR, f))
8585
.filter(f => fs.readFileSync(f, 'utf8').includes('readFileSync(wasmPath)'));
8686

87+
let patchedCount = 0;
8788
for (const loaderPath of loaderFiles) {
8889
let content = fs.readFileSync(loaderPath, 'utf8');
8990

@@ -107,6 +108,15 @@ if (fs.existsSync(wasmBinaryPath)) {
107108
content = content.replace(original, patched);
108109
fs.writeFileSync(loaderPath, content);
109110
console.log(`Embedded WASM integrity check in ${loaderPath} (sha256:${wasmHash.slice(0, 16)}...)`);
111+
patchedCount++;
110112
}
111113
}
114+
115+
if (loaderFiles.length > 0 && patchedCount === 0) {
116+
console.warn(
117+
'WARNING: WASM integrity patch (Patch 2) did not match any loader files. ' +
118+
'wasm-bindgen output may have changed. The published package will NOT ' +
119+
'include runtime WASM integrity verification.'
120+
);
121+
}
112122
}

0 commit comments

Comments
 (0)