# CVE-2026-82642: Readest: unsanitized iframe srcdoc attribute in the EPUB sanitizer can lead to arbitrary code execution

> Attackers can execute arbitrary code via unsanitized iframe srcdoc attributes in EPUB files, bypassing DOMPurify restrictions in Readest.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 30 Aug 2026
- **Updated:** 31 Aug 2026
- **Also known as:** GHSA-p4x7-pf2c-xrvj, GHSA-wvmc-79x2-m97w

## What is CVE-2026-82642?

CVE-2026-82642 is a high-severity cross-site scripting vulnerability in readest, published on 30 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Readest is an open-source e-book reader built on Tauri. In versions prior to 0.11.16, EPUB chapter HTML is sanitized with DOMPurify using a configuration that forbade only the <script> tag (FORBID_TAGS: ['script']) in apps/readest-app/src/services/transformers/sanitizer.ts. DOMPurify does not parse the contents of the srcdoc attribute on <iframe> elements, treating it as an opaque string attribute, so an attacker who can get an <iframe> element to survive sanitization can embed a complete HTML document containing a <script> tag inside srcdoc and have it execute when the browser renders the iframe. The content iframe is configured with sandbox="allow-same-origin allow-scripts", so script executing inside it shares the parent origin and can reach parent.parent.__TAURI_INTERNALS__.invoke(...), giving access to every Tauri IPC command the application is permitted to use, which escalates to arbitrary code execution. The payload can be made invisible (zero-size, transparent iframe) so the reader sees only normal book text. Version 0.11.16 hardened the sanitizer configuration by adding 'iframe', 'object' and 'embed' to FORBID_TAGS and adding 'srcdoc' to FORBID_ATTR.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2026-82642?


## How do I fix CVE-2026-82642?

No fix has been published for CVE-2026-82642 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-82642 being exploited?

There is no known exploitation of CVE-2026-82642 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-82642 and fix it if it is affected.

What it is: CVE-2026-82642 is a high-severity cross-site scripting vulnerability in readest, published on 30 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-82642 in the wild and no public exploit code.

Affected product: readest. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-82642/ (Markdown: https://insights.sbomify.com/CVE-2026-82642/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-82642
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-82642
- OSV: https://osv.dev/vulnerability/CVE-2026-82642

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-82642/
Summaries are generated and may contain mistakes; the official description above is the record.
