Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-52880 Overview
CVE-2025-52880 is a Cross-Site Scripting (XSS) vulnerability in Komga, a self-hosted media server for comics, manga, magazines, and eBooks. The flaw affects versions 1.8.0 through 1.21.3 when serving EPUB resources, both via the API and through the built-in EPUB reader. An attacker who places a malicious EPUB file in a Komga library can execute arbitrary JavaScript in the context of any user who opens the file. When the victim is an administrator, the XSS can be chained with server-side command configuration to achieve arbitrary code execution. The issue is tracked under CWE-799 and was fixed in Komga 1.22.0.
Critical Impact
Chained with admin-controlled server-side commands, this XSS can escalate to arbitrary code execution on the Komga host.
Affected Products
- Komga versions 1.8.0 through 1.21.3
- Komga EPUB reader component
- Komga API endpoints serving EPUB resources
Discovery Timeline
- 2025-06-24 - CVE-2025-52880 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-52880
Vulnerability Analysis
Komga serves EPUB content directly to the browser, both through API endpoints and inside its JavaScript-based EPUB reader. EPUB files are ZIP archives containing XHTML, CSS, and JavaScript resources. When Komga delivers those resources without stripping or sandboxing active content, scripts embedded inside the EPUB execute in the same origin as the Komga web interface.
An attacker places a crafted EPUB in any library accessible to a target user. When an administrator opens the book in the reader, the embedded script runs with the admin's session cookies and CSRF context. Because Komga exposes administrative APIs that control server-side command execution hooks, the attacker can reconfigure these hooks and achieve remote code execution on the host.
Root Cause
The underlying weakness is improper neutralization of script-capable content inside EPUB resources before they are served to authenticated clients. Komga trusted the contents of library files and did not isolate EPUB rendering from the main application origin. This is classified as CWE-799: Improper Control of Interaction Frequency in the NVD record, though the behavior aligns with classic stored XSS semantics.
Attack Vector
Exploitation requires a malicious EPUB to be present in a Komga library and subsequently opened in the EPUB reader by an administrator. The attack is network-reachable but requires high privileges to stage the file and user interaction to trigger it. The patch in commit 5f9cc44 adjusts how Komga parses EPUB structure during analysis, as shown in the fixed getDivinaPages logic:
fun getDivinaPages(
epub: EpubPackage,
isFixedLayout: Boolean,
- pageCount: Int,
analyzeDimensions: Boolean,
): List<BookPage> {
if (!isFixedLayout) {
logger.info { "Epub Divina detection failed: book is not fixed layout" }
return emptyList()
}
+ val pageCount =
+ run {
+ val spine =
+ epub.opfDoc
+ .select("spine > itemref")
+ .map { it.attr("idref") }
+ .mapNotNull { idref -> epub.manifest[idref]?.href?.let { normalizeHref(epub.opfDir, it) } }
+
+ epub.zip.entries
+ .toList()
+ .count { it.name in spine }
+ }
val pagesWithImages =
epub.opfDoc
.select("spine > itemref")
Source: gotson/komga commit 5f9cc44
Detection Methods for CVE-2025-52880
Indicators of Compromise
- EPUB files uploaded by non-admin users containing <script> tags, inline event handlers, or references to external JavaScript inside XHTML spine entries.
- Unexpected modifications to Komga server-side command or task-execution configuration shortly after an admin session opened a new EPUB.
- Outbound HTTP requests from the admin browser to attacker-controlled hosts originating from the Komga reader origin.
Detection Strategies
- Scan EPUB files on disk for XHTML content containing executable script constructs before they are opened by privileged users.
- Review Komga audit and access logs for admin accounts opening newly added EPUBs from untrusted library sources.
- Monitor the Komga configuration endpoints for changes to command hooks, especially following reader activity.
Monitoring Recommendations
- Alert on process creation by the Komga service user that is not tied to legitimate library scanning or conversion jobs.
- Capture outbound network connections from the Komga host and flag unusual destinations.
- Track version strings in /actuator/info or the UI to confirm no instance runs between 1.8.0 and 1.21.3.
How to Mitigate CVE-2025-52880
Immediate Actions Required
- Upgrade Komga to version 1.22.0 or later, which contains the fix from commit 5f9cc44.
- Restrict library write access so only trusted operators can introduce EPUB files.
- Audit existing libraries for EPUBs added by low-trust users and quarantine suspicious files before any admin opens them.
Patch Information
The maintainers released a patch in Komga 1.22.0. Technical details and the fix are documented in GitHub Security Advisory GHSA-m7mm-6jxp-2m4x and the corresponding commit 5f9cc44.
Workarounds
- Avoid opening untrusted EPUB files in the Komga reader while using an administrator account; use a non-privileged account for routine reading.
- Place a reverse proxy in front of Komga and enforce a strict Content Security Policy that blocks inline scripts for EPUB resource paths.
- Serve EPUB resources from a separate hostname or sandboxed origin so script execution cannot reach the main Komga session.
# Example: upgrade Komga Docker deployment to the patched release
docker pull gotson/komga:1.22.0
docker stop komga && docker rm komga
docker run -d --name komga \
-p 25600:25600 \
-v /path/to/config:/config \
-v /path/to/data:/data \
gotson/komga:1.22.0
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

