PDFWebTool Governance & Trust
Security & Data Handling Architecture
Last Updated: November 10, 2026 · Canonical URL:
https://pdfwebtool.in/security-and-data-handlingSecurity in document processing depends on verifiable engineering controls, not marketing buzzwords. Here is how PDFWebTool protects your files and our server infrastructure.
1. Strict Magic-Byte & File Signature Validation
Before any uploaded file is passed to a PDF engine, parser, or child process, our security middleware (lib/security-infra.js) inspects the binary file header (magic bytes) rather than trusting the file extension:
- PDF Tools: Verifies the
%PDF-signature within the first 1,024 bytes. Renamed executables, HTML error pages, or corrupted files are rejected immediately with HTTP400. - Image Tools: Verifies genuine JPEG (
FF D8 FF), PNG (89 50 4E 47), or WebP signatures. - Office Tools: Verifies PKZIP OpenXML containers (
50 4B 03 04) and OLE2 Compound Document headers (D0 CF 11 E0). - Universal Size Cap: Enforces a strict 100 MB maximum payload limit on both direct uploads and chunked JSON uploads.
2. Sandboxed Native Execution (execFile & Ghostscript -dSAFER)
- Zero Shell Interpolation: PDFWebTool never passes filenames or user strings to shell command strings (
child_process.exec). Every Ghostscript, LibreOffice, and Tesseract invocation usesexecFile/execFileAsyncwith explicit argument arrays. - Ghostscript File Access Sandboxing: Every Ghostscript invocation runs with
-dSAFERand explicit--permit-file-read=and--permit-file-write=flags restricted to the specific temporary request file path.
3. Ephemeral Processing & Guaranteed /tmp Deletion
Uploaded files are processed in isolated temporary files under os.tmpdir(). Cleanup is enforced at three independent layers:
- Engine-Level
finallyBlocks: Every Ghostscript, LibreOffice, OCR, and redaction worker removes its temporary working directory inside atry { ... } finally { fs.rmSync(tmpDir, { recursive: true, force: true }); }block. - Request-Completion Middleware: Express
res.on("finish")andres.on("close")hooks unlink any Multer disk-buffered upload immediately after the HTTP response completes. - Periodic Stale Sweep: A background timer sweeps any orphaned upload chunks every 5 minutes.
4. SSRF Protection & Concurrency Semaphores
- SSRF Prevention on URL Fetching: When converting a webpage URL in HTML to PDF,
fetchUrlSafeFromSsrfresolves DNS records and blocks loopback (127.0.0.0/8,::1), private networks (10.0.0.0/8,172.16.0.0/12,192.168.0.0/16), and cloud metadata endpoints (169.254.169.254). - Heavy-Job Concurrency Semaphore: CPU- and memory-intensive jobs (Ghostscript rasterization, OCR, Redaction, Office conversion) are wrapped in
withHeavyJobSlot()so concurrent bursts queue safely without crashing container memory. - Source File Protection: Static file serving is locked to an explicit allowlist so backend code and configuration files are never publicly accessible.
5. Honest Compliance & Limitation Disclosures
PDFWebTool is currently in Public Beta. We do not claim third-party compliance certifications (such as SOC 2 Type II, ISO/IEC 27001, HIPAA, or CASA) that have not been formally audited. Furthermore, users should always note:
- Use Redact PDF (which flattens pages to 200 DPI bitmaps via Ghostscript and purges metadata) whenever you need permanent, irreversible content removal.
- Use Sign PDF for visual electronic signatures; use a licensed CA hardware token if you require a cryptographic PKCS#7 / X.509 digital signature.