/

CVE-2026-82642

Severity:

HIGH RISK

(8.8)

Stored XSS (CWE-79) in Readest EPUB Content Sanitizer

CVE-2026-82642

Awaiting Analysis

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(8.8)

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

Readest may allow active HTML content embedded in an EPUB chapter to bypass incomplete sanitization and execute JavaScript inside a rendered content iframe. If an attacker can supply or influence book content, the script may access the application's Tauri IPC bridge and potentially achieve arbitrary code execution with the application's privileges.

Affected context

The issue occurs in Readest builds that sanitize EPUB chapter HTML while forbidding only selected tags, without also blocking iframe-based document containers and related attributes. Risk is higher when untrusted or attacker-controlled EPUB content is opened and the rendered content iframe permits scripts and shares the application's origin.

Exploit preconditions

  • Attack surface: EPUB chapter HTML rendered by the Readest desktop application
  • Required access: Ability to provide, modify, or distribute an EPUB containing attacker-controlled markup
  • Trigger point: Sanitized chapter content is inserted into the application's content iframe and rendered
  • Why exploitation is possible: The sanitizer may retain an iframe and its srcdoc attribute while treating the attribute value as opaque, allowing active document content to execute within a privileged application context

Why this happens

The vulnerability results from incomplete HTML sanitization that blocks a specific executable tag but does not remove all browser features capable of creating active documents.

DOMPurify may not recursively parse the contents of an iframe srcdoc attribute as independent HTML during sanitization. When the surrounding iframe and attribute survive, browser rendering can interpret the embedded document and execute script. Because the content iframe is configured with script execution and same-origin access, that script may reach the application's Tauri IPC interface. This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

Potential impact

  • Arbitrary JavaScript execution in the rendered content context
  • Access to Tauri IPC commands exposed to the application
  • Execution of operating-system actions permitted to the application
  • Disclosure, modification, or destruction of accessible local data
  • Potential compromise of the user's desktop environment

General mitigation guidance

Mitigation generally focuses on treating EPUB content as untrusted active content and eliminating browser features that can create executable subdocuments.

Common defensive patterns include:

  • Using an allowlist-based HTML sanitizer with explicit handling for nested document containers
  • Blocking iframe, object, embed, srcdoc, and other active-content features unless they are strictly required
  • Applying context-appropriate validation to both elements and attributes
  • Separating untrusted book content from privileged application origins
  • Disabling script execution and minimizing exposed Tauri IPC commands for content-rendering contexts
  • Enforcing least privilege for filesystem, process, and application capabilities
  • Rendering untrusted content in an isolated environment with restrictive browser policies

How teams detect issues like this

Detection can combine static analysis, review of sanitizer policy, and runtime security controls.

Useful approaches include:

  • Searching sanitizer configurations for tag-only deny lists that omit iframe-like elements and document-bearing attributes
  • Reviewing code that renders EPUB HTML with script-enabled or same-origin iframes
  • Flagging use of srcdoc, dynamic HTML insertion, and broad Tauri IPC access from content frames
  • Testing sanitization with nested document containers and active-content attributes
  • Enforcing security policies that prohibit privileged IPC exposure to untrusted rendered content
  • Using automated code review or security scanning tools to identify incomplete XSS defenses

Sources

SourceLink
github.comgithub.com/readest/readest/commit/005aa2d6157a34049bf45641c06861d606a85edb
github.comgithub.com/readest/readest/pull/4762
github.comgithub.com/readest/readest/releases/tag/v0.11.16
github.comgithub.com/readest/readest/security/advisories/GHSA-p4x7-pf2c-xrvj

Frequently asked

questions

Yes. The relevant exposure may occur when a user opens an EPUB containing attacker-controlled chapter HTML in an affected application context.

Not necessarily. An attacker generally needs a way to supply or influence the EPUB content, such as through a downloaded, shared, or otherwise untrusted book file. The user may then trigger processing by opening it.

Treat EPUB HTML as untrusted, remove active document features such as iframes and srcdoc, and isolate rendered content from privileged application origins and IPC interfaces.

Use allowlist-based sanitization, test nested browser parsing behavior, disable unnecessary scripting, expose only narrowly scoped capabilities, and apply least privilege to desktop application integrations.

Find out what's already
exploitable in your codebase.