Files
epub-tools/public/docs/PRIVACY-SECURITY.md
T
zemion efd80eb18a
Verify / verify (push) Canceled after 0s
Release EPUB Tools 0.2.0
2026-09-02 08:53:49 +02:00

3.0 KiB

Privacy and security

All source and generated publication data remains in the browser. The app has no telemetry, account, analytics, remote font, CDN, or default network integration. The production CSP keeps connect-src and worker sources same-origin.

EPUB input is adversarial. Before extraction the app enforces file, entry, expanded-size, per-entry, expansion-ratio, duplicate-name, and path rules. Required XML is size-bounded, supports UTF-8/UTF-16, and rejects DTD/entity declarations. ZIP-encrypted entries cannot be read. META-INF/encryption.xml is inspected: the standardized IDPF font-obfuscation mask is decoded locally, while unsupported protection is reported and never circumvented.

HTML/XHTML, Markdown, and plain-text adapters accept at most 16 MiB of valid UTF-8. HTML is parsed inertly and copied through a small structural element/attribute allowlist; scripts, styles, forms, event handlers, embedded media, external resources, and non-fragment links are not transferred. The adapter bounds nodes, nesting and Markdown lines, derives a local content identifier with Web Crypto, and then sends its generated one-chapter EPUB through the same strict archive and reader path. The reported losses are part of the resulting workspace rather than a claim of source fidelity.

Content documents are never mounted into the application DOM. DOMPurify removes active elements and event handlers; regular and namespaced SVG navigation/resource attributes are neutralized or replaced with bounded local object URLs; and rendering happens inside a scriptless sandboxed iframe with its own restrictive CSP. The iframe has allow-same-origin solely so trusted application code can intercept internal links, scroll to fragments, and capture a quote the user explicitly selected; it receives no script, form, popup, top-navigation, download, modal, or device permissions. Stylesheets/resources are bounded, CSS imports and external URLs are removed, object URLs are reused per resource and revoked when chapters change.

Search operates on bounded extracted text. Bookmarks and annotations remain in React memory unless the user explicitly downloads their JSON; importing validates schema, counts, path safety, field sizes, and publication identifier. Derived HTML/Markdown/text exports intentionally omit active content and network resources and are lossy reading-order representations, not publication-preserving conversions. Standalone HTML is rebuilt through a strict DOMPurify structural allowlist that excludes meta refreshes, base URLs, templates, frames, links, media and event/style attributes, then receives a deny-by-default CSP.

Validation is intentionally bounded and incomplete. It does not establish publication safety, conformance, accessibility, authenticity, ownership, or freedom from hidden data. Reports identify the checks performed and relevant unsupported areas. Rebuilding changes compressed bytes and invalidates signatures; it is disabled for unsupported encrypted publications. IDPF-obfuscated fonts are re-keyed if the unique publication identifier changes.