Skip to content
VaelJS Blog

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.

  • 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 unsafe isolation: Core logic enforces #![forbid(unsafe_code)], avoiding unsafe across tar/gzip extraction, SQL placeholder scanning, JSONC parsing, HTTP routing, SSH transport, and node:* shims. unsafe is isolated strictly to V8 zeroizing ArrayBuffer backing-store cleanup (vaeljs-core/src/crypto_shamir.rs) and rquickjs C FFI bindings (vaeljs-lite-core), with #![forbid(unsafe_code)] enforced on all pure-Rust crates.
  • Zero-node_modules supply-chain hygiene: npm: extraction uses a custom zero-unsafe bounded tar/gzip parser (vaeljs-npm), verifies sha512 SRI 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.ts runtime parity: dts_drift integration tests boot both vjs and vjs-lite and verify exported module names and symbols match vaeljs-dts/types/ on every build.
  • Deterministic footprint & engine isolation: eng/size/check.sh and CI graph checks guarantee QuickJS builds (vaeljs-lite) never pull V8, Tokio, or Hyper, and V8 builds (vaeljs) never pull QuickJS.

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):

  1. jsonc (vaeljs-manifest / --test fuzz_jsonc): BOM accounting, 1 MiB / 128-depth limits, unterminated comments, trailing commas, Manifest::parse, and duplicate-key rejection.
  2. archives (vaeljs-archive-core / --test fuzz_archives): Format detection and bounded unpack_bytes (tar, tar.gz, tar.zst, zip) under ArchiveLimits.
  3. semver_exports (vaeljs-npm / --test fuzz_semver_exports): SemVer (NpmVersion, NpmRange, VersionConstraint, NpmSpecifier) and package.json exports resolution.
  4. npmrc (vaeljs-npm / --test fuzz_npmrc): .npmrc parsing (parse and untrusted parse_project auth isolation).
  5. jsr_url (vaeljs-remote / --test fuzz_jsr_url): JSR specifiers/metadata, github_url, and HTTPS URL validation.
  6. http_router_cookies (vaeljs-http-core / --test fuzz_http_router_cookies): Router precedence (literal > {param} > {wildcard...}), Cookie parsing, and Set-Cookie validation/CRLF rejection.
  7. sql_rewriter (vaeljs-dbapi / --test fuzz_sql_rewriter): Lexical @name / ? compile across SQLite, PostgreSQL, MySQL, and MSSQL dialects, ensuring multi-statement smuggling and mixed placeholders fail closed.
  8. templates (vaeljs-template-core / --test fuzz_templates): Template compilation/rendering, HTML5 contextual auto-escaping, and deterministic TemplateOptions resource bounds.
  9. crypto_envelopes (vaeljs-crypto-core / --test fuzz_crypto_envelopes): NEO1 envelopes, 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-audit scans both the root Cargo.lock and vaeljs-playground-wasm/Cargo.lock (failing on warnings and yanked crates).
    • cargo-deny checks advisories, bans, licenses, and sources across the full workspace (--workspace --all-features), vaeljs-lite, and vaeljs-playground-wasm (blocking RUSTSEC-* advisories, yanked crates, unallowlisted licenses, unknown git/registry sources, and banned stacks such as openssl*, 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 both rust and javascript-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 verified SHA256SUMS.txt covering 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, and SHA256SUMS.txt, plus SPDX SBOM attestations (actions/attest-sbom) for all release archives.
  • Planned Post-Alpha Enhancements: Automated cargo-geiger unsafe-audit baselines, keyless Sigstore cosign bundles, and offline minisign signatures over SHA256SUMS.txt are planned post-alpha additions and are not yet run in CI.