Repository navigation
ShellGuard v0.0.2.6
π¦ ShellGuard β Release v0.0.2.6
"The Cryptographic Audit Hardening & Third-Party Auditability" β Phase 24: Vector Parity, Mechanized Constant-Time Sweeps, Auditor's Battery & Threat Model Addendum
ClawStack Studios Β©β’ Β· 2026-10-18 Β· AGPL-3.0
The reef achieves mathematical certainty and transparent third-party auditability. ShellGuard v0.0.2.6 (Build 28) hardens the cryptographic core β proving pure-TypeScript WebCrypto fallback parity against official NIST/RFC standards vectors, mechanizing constant-time comparisons across all authentication and administrative key paths, codifying an automated Docs-as-Code claim battery into the build gates, and formalizing runtime operational realities in the threat model.
βββββββββββ ββββββββββββββ βββ βββββββ βββ βββ ββββββ βββββββ βββββββ
βββββββββββ ββββββββββββββ βββ βββββββ βββ βββ ββββββββ ββββββββ ββββββββ
ββββββββββββββββββββββ βββ βββ βββ ββββ βββ βββ ββββββββ ββββββββ ββββββββ
ββββββββββββββββββββββ βββ βββ βββ βββ βββ βββ ββββββββ ββββββββ βββββββββ
βββββββββββ βββββββββββββββββββββββββββ βββββββββββββββββ βββ βββ βββ βββ βββββββββ
βββββββββββ βββββββββββββββββββββββββββ βββββββ βββββββ βββ βββ βββ βββ βββββββ
~ **ClawStack StudiosΒ©β’** ~
π The Core Summary
Welcome to v0.0.2.6 (Build 28) of ShellGuard! This release elevates our cryptographic assertions from declarative claims into executable mathematical proofs. We have closed the final open soft spot in our cryptography suite: unskipping and proving our pure-TypeScript WebCrypto fallback engine against official published standards vectors (FIPS 180-4 SHA-256, RFC 2104 HMAC-SHA256, RFC 5869 HKDF-SHA256, and NIST SP 800-38D AES-256-GCM), achieving byte-identical parity with Node.js native cryptographic primitives. Furthermore, we have mechanized constant-time comparisons across all sensitive key comparison sites, introduced an automated Docs-as-Code claim battery into our build gates, and enriched our threat model with transparent operational boundaries.
π Key Themes & Highlights
π‘οΈ 1. Pure-TS WebCrypto Fallback Vector Parity (Task 47)
- Unskipped Standards Verification (
tests/unit/webCryptoFallback.test.ts): The pure-TS WebCrypto fallback test suite (skipped since v0.0.1.2) is now fully unskipped, green, and executed on every CI run. - Published Vector Compliance:
- SHA-256: Verified against official FIPS 180-4 published test vectors (
"","abc", 1M'a'stress vectors). - HMAC-SHA256: Verified against RFC 2104 / RFC 4231 standard test vectors.
- HKDF-SHA256: Verified against RFC 5869 test vectors (extract-and-expand with PRK, salt, and info bindings).
- AES-256-GCM: Verified against NIST SP 800-38D standard vectors (256-bit zero key, 96-bit IV, 128-bit plaintext, tag verification).
- SHA-256: Verified against official FIPS 180-4 published test vectors (
- Byte-Identical Native Parity: Proved that pure-TS fallback output matches native Node.js
cryptooutput byte-for-byte across every supported cipher and hash.
β±οΈ 2. Mechanized Constant-Time Comparison Sweep (Task 47)
- Universal Constant-Time Utility (
src/server/utils/crypto.ts): ImplementedconstantTimeCompare(a, b)using Node'scrypto.timingSafeEqualwith dummy comparison buffering on length mismatch, eliminating timing side-channel leaks. - Key-Path Refactoring: Refactored
src/server/routes/auth.ts,src/server/routes/admin.ts, andsrc/server/middleware/auth.tsto route all secret comparisons (passwords, tokens, human keys, agent keys) throughconstantTimeCompare. - Automated AST/Regex Build Gate (
tests/build-gates.test.ts): Wired an automated sweep asserting zero raw===or!==comparisons on secret tokens or key material across server routes and middleware.
π§ͺ 3. The Auditor's Claim Battery (Task 48)
- Docs-as-Code Invariant: Codified an automated claim battery in
tests/build-gates.test.tsto ensure documentation strictly bows to code reality:- L1 (Rate Limiters): Asserts documented rate limits match
src/server/middleware/rateLimiter.ts. - L3 (Key Prefixes): Asserts documented key prefix strings (
hu-,lb-) matchsrc/server/utils/crypto.tsandsrc/lib/crypto.ts. - L4 (Permission Masks): Asserts documented permission masks match Zod schemas in
src/server/validation/schemas.ts. - L5 (AAD Namespaces): Asserts documented AAD namespace templates match cryptographic test fixtures.
- L1 (Rate Limiters): Asserts documented rate limits match
- Falsifiable Mutation Verification: Tested to ensure any planted documentation lie immediately and loudly breaks the CI test oracle.
π 4. Threat Model Addendum & Honest Security Boundaries (Task 48)
- Transparent Operational Realities (
SECURITY.md&docs/architecture/threat-model.md):- In-Process Rate Limiting: Explicitly documented that in-memory rate limiting resets upon container restart and multi-instance clusters share no state (under YAGNI, no Redis requirement).
- LRU Eviction: Documented per-key LRU cache eviction semantics with safe fallback to SQLite database lookups.
- Redaction Coverage: Enumerated credential masking and redaction regexes used throughout logging and error pipelines.
- Side-Channel Boundary: Documented in
project/encryption-layers-spec.mdΒ§5 that pure-TS AES-GCM provides functional LAN availability on plain HTTP origins, not hardware-level side-channel immunity.
ποΈ Architectural Topology Map
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π Client Layer (React 19 + Vite 6) β
β βββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββββ β
β β WebCrypto Subtle API β β Pure-TS WebCrypto Fallback Engine β β
β β (HTTPS / Secure Origin) β β (FIPS 180-4, RFC 2104, RFC 5869, β β
β β β β NIST SP 800-38D Vector Parity) β β
β βββββββββββββ¬ββββββββββββββ ββββββββββββββββββββ¬ββββββββββββββββββββ β
β β β β
β βΌ βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Zero-Knowledge Cryptographic Layer (ShellCryption) β β
β β (Client-side AES-256-GCM + PBKDF2 600k / HKDF Key Derivation) β β
β βββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β (Opaque Ciphertext + constantTime Auth)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π Server & API Layer (Express 5 Security Kernel) β
β βββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ β
β β constantTimeCompare() Guards β In-Process Rate Limiter β β
β β (Zero === comparisons on secrets) β (Documented container memory) β β
β βββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ€ β
β β Auditor's Battery Build Gate β requirePermission() Claws β β
β β (L1-L5 docs-bow-to-code checks) β (Strict Zod schema masks) β β
β βββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ποΈ Bedrock Storage (SQLite + SQLCipher) β
β βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ β
β β vault_pearls / notes / keysβ <βββ> β segregated audit.sqlite β β
β β (Layer 2 metadata encryptedβ β (Tamper-evident audit trails β β
β β + Layer 1 ShellCryption) β β never joined with vault DB) β β
β βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π¦ Changes by Layer
| Component | Files | Description |
|---|---|---|
| Cryptographic Primitives | src/server/utils/crypto.ts, src/lib/webCryptoFallback.ts |
Added constantTimeCompare() with dummy length buffering; verified pure-TS standards vector parity. |
| Authentication & Middleware | src/server/routes/auth.ts, src/server/routes/admin.ts, src/server/middleware/auth.ts |
Refactored all token/password equality checks to consume constantTimeCompare(). |
| Verification & Build Gates | tests/unit/webCryptoFallback.test.ts, tests/build-gates.test.ts |
Unskipped fallback test suite with NIST/RFC vectors; added Auditor's Battery and mechanized constant-time comparison CI sweep. |
| Threat Model & Security Policy | SECURITY.md, docs/architecture/threat-model.md, project/encryption-layers-spec.md |
Formalized auditor's addendum (rate limiter resets, LRU eviction, redaction regexes, LAN side-channel boundary). |
π Commit Ledger (Since v0.0.2.5)
31d28c1β feat(crypto): merge Phase 24 crypto hardening & auditor battery (PR #6)4ef6e07β docs(agents): ratify post-review verification & adjacency sweep protocolaa59622β feat(crypto): Phase 24 crypto hardening and auditor battery7051310β chore(jules): pre-heat Phase 24 tasks, targeted knowledge, and epistemic escape hatchf7f4684β feat(agents): codify prep-jules-work skill and epistemic escape hatch
π Upgrade & Verification Instructions
Upgrading via Docker / Unraid
docker pull ghcr.io/clawstackstudios/shellguard:latest
docker restart shellguardUpgrading from Source
git fetch --tags
git checkout v0.0.2.6
npm install
npm run build
npm run scuttle:prod