CVE-2024-39307
Description
Kavita is a cross platform reading server. Opening an ebook with malicious scripts inside leads to code execution inside the browsing context. Kavita doesn't sanitize or sandbox the contents of epubs, allowing scripts inside ebooks to execute. This vulnerability was patched in version 0.8.1.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Kavita reading server fails to sanitize or sandbox ebook content, allowing malicious scripts in EPUB files to execute in the user's browser context and perform actions on behalf of the logged-in user.
Vulnerability
Kavita, a cross-platform reading server, does not sanitize or sandbox the contents of EPUB files. This allows malicious scripts embedded within ebooks to execute in the browsing context of the user who opens the file [1]. The root cause is the lack of any content security measures for ebook rendering, enabling arbitrary JavaScript execution.
Exploitation
An attacker can craft an EPUB file containing a malicious script, such as one that retrieves the user's authentication token from localStorage and makes API requests with it [1]. The user must open the crafted ebook, but no additional authentication is required beyond the user being logged into Kavita. Distribution could occur via pirate sites or online conversion services [1].
Impact
Once executed, the script can perform any action that the logged-in user can, including leaking sensitive configuration data like SMTP credentials [1]. However, due to Kavita's limited API surface, the attack does not lead to remote code execution on the server itself. The impact is confined to actions available through the user's session.
Mitigation
The vulnerability has been patched in Kavita version 0.8.1 [1]. Users are advised to update to the latest version to prevent exploitation.
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
1News mentions
0No linked articles in our index yet.