Skip to content

Security: BalbyyO/VLP-manual-generator

SECURITY.md

Security Policy

Supported Versions

Version Supported Notes
0.3.x (beta 0.3.7) Yes Current pre-release hardened non-root container (alpine:3.24, nodejs >= 24.22.3-r0, brotli-libs >= 1.2.1-r0, libcrypto3/libssl3 >= 3.5.9-r1, zlib >= 1.4-r0), HKDF-SHA256 enc:v2: crypto, server-enforced MFA & step-up auth, sandboxed preview, and CVE-2026-111497 mitigation
0.3.6-beta Security fixes Superseded by 0.3.7-beta
0.3.5-beta Security fixes Superseded by 0.3.7-beta
0.2.x (beta 0.2.1) Security fixes Superseded by 0.3.x
main Yes Active development branch

Reporting a Vulnerability

Please do not report security vulnerabilities through public GitHub issues.

Report vulnerabilities privately using GitHub Security Advisories:

What to Include

  • Description of the issue and affected file(s) or API endpoint(s)
  • Steps to reproduce or a minimal proof-of-concept payload (such as a malformed XML/ZIP input or path traversal attempt)
  • Potential impact (e.g., XSS in preview/exported HTML, arbitrary file write, container misconfiguration)

Response Targets

  • Initial Acknowledgment: Within 3 business days
  • Triage & Fix Plan: Within 7 days for confirmed vulnerabilities

Security Architecture & Air-Gapped Design

VLP-manual-generator is engineered for offline and air-gapped training environments:

  1. Zero External Network Dependencies

    • No external CDNs, remote fonts, third-party analytics, telemetry, or external AI APIs are used at runtime.
    • The Docker image runs cleanly with --network none.
  2. Authentication, HKDF Cryptography, Enforced MFA & HTTP Hardening (server.js)

    • Password Hashing & Concurrency: Passwords (8–128 characters) are hashed asynchronously with per-user 32-byte random CSPRNG salts via crypto.scrypt (N=16384, r=8, p=1, keylen=64) and verified using crypto.timingSafeEqual, with a serialized mutex (withUsersLock) guarding user-store mutations.
    • HKDF-SHA256 Domain-Separated Keys & PII Encryption: Separate 32-byte keys are derived via crypto.hkdfSync from /data/.secret_key (0600) or APP_SECRET_KEY (minimum 32 characters enforced at startup) for AES-256-GCM PII/secret encryption (enc:v2: with vlp-pii-v2 AAD), blind lookup indexes, API key HMACs, and HS256 session tokens—with seamless automatic migration from legacy enc:v1: records on sign-in.
    • Blind Lookup Indexes: Email and username uniqueness and sign-in resolution use keyed HMAC-SHA256 blind indexes so plaintext PII never appears in /data/users.json or audit logs.
    • Enforced MFA, Step-Up Auth & Session Hardening: Admins can enforce requireMfa server-side (blocking workspace/API access until enrolled), disabling MFA or minting API keys requires currentPassword step-up verification, login TOTP codes are protected against replay within the 30-second window, and logout revokes the session token server-side via sessionVersion. Sessions use HttpOnly; SameSite=Strict cookies (plus Secure when TLS/TRUST_PROXY=true is active), Origin/Sec-Fetch-Site CSRF checks, bounded brute-force throttling (HTTP 429), strict Content-Security-Policy, Cross-Origin-Opener-Policy: same-origin, Cross-Origin-Resource-Policy: same-origin, X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, and Referrer-Policy: no-referrer.
    • CVE-2026-111497 ("Node2Shell") & Scoped Payload Limits: Compressed request bodies (Content-Encoding other than identity) are rejected with HTTP 415 and inflate: false is set on all Express body parsers; unauthenticated /api/auth/* endpoints are capped at 64kb while 100mb payloads are strictly gated behind requireActiveUser.
    • Per-User Workspace Isolation: Each active account stores its autosaves, projects, and snapshots in /data/users/<userId>/, preventing concurrent authors from overwriting one another.
  3. Filesystem, Image Upload & Decompression Controls (server.js, public/vlp-formatter.js)

    • All user-supplied IDs and filenames are sanitized through sanitizeId, sanitizeFilename, and path.basename; session JSON persistence uses atomic 0600 temporary-file writes followed by fs.renameSync.
    • Uploaded and ZIP-imported images are validated by magic bytes (PNG, JPEG, GIF, WebP, SVG), bounded to 15 MB per image, written non-destructively (SHA-256 deduplicated without overwriting differing files), and served from /api/images/* with Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox. User-supplied SVGs are sanitized via sanitizeHtmlFragment() on upload.
    • .zip imports enforce entry (500), content.xml (25 MB), total uncompressed (250 MB), and prototype-pollution path guards; XML parsing enforces MAX_XML_DEPTH = 64; PDF PNG decoding enforces 8192x8192 / 32 MP / 128 MB zlib.inflateSync limits.
  4. HTML/XML Escaping & Sandboxed Preview Isolation (public/vlp-formatter.js, public/index.html, public/app.js)

    • Plain text inputs, XML text nodes, and XML attributes are entity-escaped deterministically via escapeHtmlPreserveEntities, escapeXmlText, and escapeXmlAttr.
    • Live HTML rendering runs inside #vlpPreviewFrame with sandbox="allow-same-origin" (scripts disabled) and sanitizeHtmlFragment() deterministically strips active script vectors (<script>, <iframe>, <object>, <embed>, <foreignObject>, on*= handlers, and javascript:/vbscript:/data:text/html URIs) from rawHtml previews, exports, and uploaded SVGs while preserving VLP CKEditor markup and <style> blocks.
  5. Non-Root Container & Deployment Recommendations (Dockerfile, docker-compose.yml)

    • The container drops privileges via su-exec to unprivileged UID/GID 10001 (vlp) after ensuring /data (0700) permissions; docker-compose.yml enables read_only: true, cap_drop: [ALL], no-new-privileges:true, tmpfs /tmp, and pids_limit: 256.
    • When deploying behind a TLS-terminating reverse proxy, set TRUST_PROXY=true so Secure cookies and HSTS headers are emitted accurately, and set a strong APP_SECRET_KEY (>= 32 characters) or persist /data/.secret_key on a dedicated volume (./data:/data).

There aren't any published security advisories