Repository navigation
Security Model
SIDHARTH SINGH edited this page Dec 3, 2026
·
1 revision
Multi-tenant HTML-to-PDF rendering is one of the highest-risk server features to expose carelessly because arbitrary templates and image tags execute fetches from inside the browser host. ONEX ships fail-closed by default.
-
Local files locked down:
allowFileAccess: falsedeniesfile://URLs and filesystem paths unless explicitly enabled and confined insidefileAccessRootvia symlink-saferealpathSync+path.relative. -
Private networks & IPv6 tunneling blocked: Rejects loopback, RFC1918, CGNAT, cloud metadata (
169.254.169.254), link-local, ULA, and recursively inspects IPv4 addresses embedded inside::ffff:0:0/96, NAT6464:ff9b::/96, and 6to42002::/16addresses while stripping trailing DNS dots and IPv6 zone IDs. -
DNS rebinding & 302 redirect chases: Resolves A/AAAA records (
checkUrlAsync) and intercepts every sub-resource request (maxRedirects: 0) up to 10 hops so external servers cannot bounce Chromium into localhost via HTTP302. -
Sandbox integrity: Blocks unsafe switches (
--no-sandbox,--disable-web-security,--remote-debugging-port) cleanly even if passed with=1. -
Signed document immutability:
optimizePdf(),mergePdfs(),extractPages(),watermarkPdf(),enforcePdfA(), andredactPdf()throwONEX_SIGNED_DOCUMENT_IMMUTABLEon signed PDFs (including widget-only signatures) unlessallowModifySigned: trueis passed. -
Hardened delivery surfaces: Constant-time SHA-256 API key comparison, streaming request size abort (
> 20 MiBdestroys socket immediately), queue overflow (503 Retry-After: 5), HTML escaping on footer templates, XML escaping on CII/XMP outputs, and no localp12Pathfilesystem reads on remote HTTP/sign.
See SECURITY.md for the complete SecurityError reference table.
- Home
- Architecture & Render Pipeline
- PDF Internals & Extraction
- Unicode 16, Fonts & Legacy Indic
- Security & SSRF Model
- Digital Signing (
signPdf) - True Redaction (
redactPdf) - Semantic Diff & Redlines (
diffPdfs) - Self-Auditing Renders (
renderVerified) - PDF/A-3b & E-Invoices (
renderEInvoice) - HTTP, MCP, CLI & Puppeteer
Handbook & Deep Analysis: bahubalisid.github.io/onex