Validation, QA & Security Gates
VaelJS is built around fail-closed validation, strict bounds, and dual-engine parity between vjs (V8) and vjs-lite (QuickJS). This page documents our concrete verification baseline, 3-tier QA gate architecture, standards Known Answer Test (KAT) targets, continuous parser fuzzing, and supply-chain security pipeline.
Current Baseline & Safety Posture
Section titled “Current Baseline & Safety Posture”- Engine-neutral core crates: Core parsers and protocol logic live in pure-Rust workspace crates (
vaeljs-crypto-core,vaeljs-fs-core,vaeljs-http-core,vaeljs-dbapi,vaeljs-ssh-core,vaeljs-node-core,vaeljs-template-core,vaeljs-npm,vaeljs-dts,vaeljs-manifest,vaeljs-remote,vaeljs-module-policy,vaeljs-builtins). - Explicit
unsafeisolation: Core logic enforces#![forbid(unsafe_code)], avoidingunsafeacross tar/gzip extraction, SQL placeholder scanning, JSONC parsing, HTTP routing, SSH transport, andnode:*shims.unsafeis isolated strictly to V8 zeroizingArrayBufferbacking-store cleanup (vaeljs-core/src/crypto_shamir.rs) andrquickjsC FFI bindings (vaeljs-lite-core), with#![forbid(unsafe_code)]enforced on all pure-Rust crates. - Zero-
node_modulessupply-chain hygiene:npm:extraction uses a custom zero-unsafebounded tar/gzip parser (vaeljs-npm), verifiessha512SRI digests and read-only (0444) SHA-256 CAS objects, never executes lifecycle scripts (preinstall/install/postinstall), and excludes native.node/shared-library binaries. - 1:1
.d.tsruntime parity:dts_driftintegration tests boot bothvjsandvjs-liteand verify exported module names and symbols matchvaeljs-dts/types/on every build. - Deterministic footprint & engine isolation:
eng/size/check.shand CI graph checks guarantee QuickJS builds (vaeljs-lite) never pull V8, Tokio, or Hyper, and V8 builds (vaeljs) never pull QuickJS.
3-Tier QA Gate Architecture
Section titled “3-Tier QA Gate Architecture”To keep pull requests fast (~10–15 minutes) while testing cross-platform filesystem/process semantics, real external binaries, load limits, and fuzzers thoroughly, verification is organized into three tiers:
| Tier | Trigger | Scope & Required Pass Criteria |
|---|---|---|
| 1. PR Gate (Fast) | Every push (dev, main) & pull_request |
cargo fmt --check, cargo clippy -- -D warnings, cargo doc -D warnings, shellcheck, eng/size/check.sh, engine-isolation, full Linux cargo test --locked (both default and --no-default-features / --all-features crate checks), vjs test tests/js/shared/*.test.{js,ts}, vjs-lite test tests/js/shared/*.test.{js,ts}, vjs test examples/webapp/app.test.ts, and fast deterministic RFC/Unicode/XSS regression vectors. |
| 2. Pre-Release Slow Gate | workflow_dispatch & blocking gate before tag release publish |
Full Rust cargo test --locked natively on macOS and Windows (exercising NTFS/APFS symlinks, Win32 UNC/device paths, CRLF handling, and platform error codes), fail-closed macos-amd64 smoke execution, containerized interop against real OpenSSH sshd / ssh-agent (vael:ssh) and age / rage (vael:age), individual opt-in Cargo feature matrix builds, plus cargo-audit and cargo-deny. |
| 3. Nightly / Scheduled Gate | Scheduled cron + manual |
Live read-only HTTPS/TLS/webpki-roots network smoke tests (registry.npmjs.org via vael:fetch + npm:, jsr.io via jsr:, and raw.githubusercontent.com via --allow-remote HTTPS in .github/workflows/nightly-smoke.yml), plus daily RustSec (cargo-audit), cargo-deny, gitleaks, and CodeQL scans in .github/workflows/security.yml. Nightly ASan cargo-fuzz runs are planned post-alpha. |
Standards & Known Answer Test (KAT) Targets
Section titled “Standards & Known Answer Test (KAT) Targets”Every cryptographic, encoding, and text-processing primitive is pinned to authoritative external vectors:
| Surface | Standards / Corpus | What Is Verified |
|---|---|---|
vael:crypto HMAC & PBKDF2 |
RFC 4231 (Cases 1–7) & RFC 6070 / RFC 7914 | Full HMAC-SHA-256/384/512 vectors including keys larger than the hash block size (131-byte keys), plus multi-block PBKDF2 (dkLen > hLen) and long passwords. |
vael:crypto AES-256 |
NIST SP 800-38D | AES-256-GCM authenticated encryption including empty-plaintext/empty-AAD vectors, tag verification, and CBC PKCS#7 boundary padding tests. |
vael:crypto bcrypt |
Openwall crypt_blowfish |
$2a$, $2b$, and $2y$ constant-time verification vectors, 8-bit character handling, cost bounds (4..=16), and explicit rejection of $2x$ and >72-byte passwords. |
vael:age |
C2SP age CCTV |
Malformed headers, non-canonical base64 padding, STREAM 64 KiB chunk boundaries and final-chunk authentication, trailing garbage rejection, and external age / rage CLI round-trips. |
vael:uuid |
RFC 9562 (Appendix A.4 / A.7) | Canonical UUID v4/v7 layout, variant/version bitfields, 48-bit Unix millisecond timestamps, and multi-threaded burst uniqueness. |
vael:strings & vael:chars |
Unicode 16.0.0 (CaseFolding-16.0.0.txt, UnicodeData-16.0.0.txt) |
Exhaustive verification across all 0..0x11_0000 Unicode scalar values so case folding and General_Category predicates never silently drift across Rust compiler upgrades. |
vael:template |
Contextual HTML / Go html/template regression vectors |
Completed contextual HTML5/URL/JS/CSS auto-escaping (html_escape / htmlEscape: true across text, quoted/unquoted attributes, URL scheme validation, <script>, <style>, comments, else if, else with, and variable reassignments) and bounded Sprig resource limits (maxSourceLength, maxNestingDepth, maxOutputLength, maxIterations, maxFunctionCalls). |
Deterministic Parser Fuzzing (Deterministic Fuzz and LSP Smoke + fuzz/)
Section titled “Deterministic Parser Fuzzing (Deterministic Fuzz and LSP Smoke + fuzz/)”Untrusted-input parsers are covered by 9 deterministic fuzz/property test harnesses running on every PR and push in the Deterministic Fuzz and LSP Smoke (fuzz-smoke) job of .github/workflows/ci.yml, paired with 9 matching standalone libfuzzer-sys targets in the workspace-excluded fuzz/ crate (keeping release builds free of fuzzer dependencies; nightly ASan cargo-fuzz runs are planned post-alpha):
jsonc(vaeljs-manifest/--test fuzz_jsonc): BOM accounting, 1 MiB / 128-depth limits, unterminated comments, trailing commas,Manifest::parse, and duplicate-key rejection.archives(vaeljs-archive-core/--test fuzz_archives): Format detection and boundedunpack_bytes(tar,tar.gz,tar.zst,zip) underArchiveLimits.semver_exports(vaeljs-npm/--test fuzz_semver_exports): SemVer (NpmVersion,NpmRange,VersionConstraint,NpmSpecifier) andpackage.jsonexportsresolution.npmrc(vaeljs-npm/--test fuzz_npmrc):.npmrcparsing (parseand untrustedparse_projectauth isolation).jsr_url(vaeljs-remote/--test fuzz_jsr_url): JSR specifiers/metadata,github_url, and HTTPS URL validation.http_router_cookies(vaeljs-http-core/--test fuzz_http_router_cookies):Routerprecedence (literal > {param} > {wildcard...}),Cookieparsing, andSet-Cookievalidation/CRLF rejection.sql_rewriter(vaeljs-dbapi/--test fuzz_sql_rewriter): Lexical@name/?compileacross SQLite, PostgreSQL, MySQL, and MSSQL dialects, ensuring multi-statement smuggling and mixed placeholders fail closed.templates(vaeljs-template-core/--test fuzz_templates): Template compilation/rendering, HTML5 contextual auto-escaping, and deterministicTemplateOptionsresource bounds.crypto_envelopes(vaeljs-crypto-core/--test fuzz_crypto_envelopes):NEO1envelopes, AES-GCM/CBC ciphers, Shamir split/combine, BLAKE, HKDF, scrypt, and bcrypt validation.
Security Scans, SBOMs & Release Provenance
Section titled “Security Scans, SBOMs & Release Provenance”CI and release automation follow strict least-privilege (permissions: contents: read on build/test jobs, 40-character commit-SHA pinned GitHub Actions, and cold release builds without cross-workflow Rust target cache reuse or mutable release-tag deletion), implemented in .github/workflows/security.yml and .github/workflows/release.yml:
- Advisory & Policy Gates (
cargo-audit+cargo-deny):cargo-auditscans both the rootCargo.lockandvaeljs-playground-wasm/Cargo.lock(failing on warnings and yanked crates).cargo-denychecks advisories, bans, licenses, and sources across the full workspace (--workspace --all-features),vaeljs-lite, andvaeljs-playground-wasm(blockingRUSTSEC-*advisories, yanked crates, unallowlisted licenses, unknown git/registry sources, and banned stacks such asopenssl*,native-tls,tar,ssh2).
- Secret Scanning (
gitleaks): Scans PR diffs and full git history on push/PR/schedule/release with explicit allowlists restricted to synthetic test fixtures. - Static Analysis (
CodeQL): Runs CodeQL (security-extended,security-and-quality) over bothrustandjavascript-typescript. - SBOMs & Checksums (
release.yml): Generates CycloneDX SBOMs (vjs-<tag>.cdx.json,vjs-lite-<tag>.cdx.json), a workspace SPDX SBOM (vaeljs-<tag>.spdx.json), and verifiedSHA256SUMS.txtcovering all release archives and SBOMs. - SLSA Build Provenance & SBOM Attestations (
release.yml): Attaches GitHub Artifact Build Provenance (actions/attest-build-provenance) for all archives, SBOMs, andSHA256SUMS.txt, plus SPDX SBOM attestations (actions/attest-sbom) for all release archives. - Planned Post-Alpha Enhancements: Automated
cargo-geigerunsafe-audit baselines, keyless Sigstorecosignbundles, and offlineminisignsignatures overSHA256SUMS.txtare planned post-alpha additions and are not yet run in CI.
