/

CVE-2026-34529

Severity:

HIGH RISK

(7.6)

Cross-Site Scripting (Stored XSS) in File Browser EPUB

CVE-2026-34529

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (Stored XSS)

CWE:

CWE-79

Impact:

Session Hijacking and Arbitrary Actions in the User's Browser

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

File Browser's EPUB preview feature fails to properly sanitize active content within uploaded EPUB files, allowing JavaScript to persist inside the application.

When a victim previews a crafted EPUB, the embedded script executes in their browser with the privileges of their authenticated File Browser session, enabling actions such as account hijacking or data access within the web UI.

Affected context

The vulnerability appears in deployments of File Browser that allow users to upload and preview EPUB documents through the web interface.

It specifically affects the EPUB preview renderer, which interprets content inside the EPUB archive and presents it within the application's origin.

The risk becomes significant where users can upload files that other users (especially privileged ones) are likely to preview, such as shared folders, multi-user instances, or externally exposed portals.

Exploit preconditions

  • Attack surface: Web UI, specifically the EPUB preview feature.
  • Required access: Ability to upload or otherwise place a crafted EPUB file in a location that another user can preview.
  • Victim interaction: A logged-in user must open the EPUB preview in their browser.
  • Trigger point: The preview renderer loads and displays the EPUB contents, including embedded HTML/JavaScript, which is executed in the context of the File Browser origin.
  • Why exploitation is possible: The EPUB content is treated as trusted and rendered without sufficient sanitization or isolation (e.g., missing HTML purification or strict sandboxing), enabling injected script to run as part of the application's pages.

Why this happens

This issue arises from insufficient output encoding and content sanitization when rendering user-controlled EPUB content within the application's origin.

EPUB files are essentially archives containing HTML-like resources; when these resources are injected into the DOM without rigorous sanitization or isolation, any embedded JavaScript can execute.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where untrusted data (EPUB content) is incorporated into web pages without proper neutralization against scripting.

Potential impact

  • An attacker-controlled script may execute with the privileges of the victim's browser session.
  • The attacker could access or exfiltrate data visible in the File Browser UI (e.g., file lists, metadata).
  • The attacker could perform actions on behalf of the victim (e.g., upload, delete, rename, or edit files) depending on the victim's permissions.
  • Session information and authentication tokens stored in web-accessible storage may be read and abused.
  • The attacker could pivot to broader browser-based attacks such as phishing overlays or drive-by download prompts within the File Browser origin.

General mitigation guidance

Effective mitigation typically relies on treating all document content, including EPUB internals, as untrusted and applying layered defenses:

  • Sanitize all HTML-like content extracted from EPUB files using a well-maintained, allowlist-based HTML sanitizer that removes scripts, event handlers, and dangerous attributes.
  • Enforce strict output encoding for any user-controlled data before inserting it into the DOM, ensuring it cannot be interpreted as executable script.
  • Render untrusted document content in hardened contexts such as sandboxed iframes with scripting disabled or heavily restricted, minimizing access to the parent application.
  • Apply content security policies (CSP) that restrict inline scripts and limit where scripts can be loaded from, to reduce the impact of XSS that slips through.
  • Design file preview features with the assumption that file contents are attacker-controlled, and avoid reusing privileged application layouts or frames for rendering them.

How teams detect issues like this

High-level detection approaches can focus on both code and behavior:

  • Static analysis: Flag code paths where EPUB or other document content is inserted into the DOM using innerHTML, template rendering, or similar APIs without passing through a recognized sanitizer.
  • Code review signals: Pay attention to file preview or document rendering features that parse archive formats (EPUB, ZIP, Office docs) and then embed resulting HTML into application views; verify they use strict sanitization and isolation.
  • Policy enforcement: Establish secure coding guidelines requiring sanitization of all user-supplied HTML fragments and review of any exceptions.
  • Security testing: Use automated and manual testing to upload crafted EPUB files containing benign script proofs-of-concept, verifying that no script executes during preview.
  • Automated review tools or SAST platforms can be configured with custom rules to detect unsafe DOM injection patterns associated with document preview logic.

Sources

SourceLink
github.comgithub.com/filebrowser/filebrowser/releases/tag/v2.62.2
github.comgithub.com/filebrowser/filebrowser/security/advisories/GHSA-5vpr-4fgw-f69h

Frequently asked

questions

Yes, if the File Browser instance is exposed over a network and attackers can upload or supply EPUB files that others may preview. However, the malicious script runs in the victim's browser, not on the server itself.

The attacker needs a way to introduce a crafted EPUB into the system—typically through upload or shared storage—and for another authenticated user to open its preview. The attacker does not necessarily need high-privilege credentials if the environment allows general user uploads.

Treat all document content as untrusted, sanitize it with a strict allowlist-based HTML sanitizer, and render it in sandboxed environments where active content (scripts) cannot run or has heavily constrained capabilities.

Adopt a standard approach for any feature that renders user-supplied or file-derived markup: mandatory sanitization, careful output encoding, robust CSP, and architectural separation between the main application UI and untrusted content previews. Integrate these requirements into design reviews, code review checklists, and automated security testing.

Find out what's already
exploitable in your codebase.