CVE-2026-25635 Overview
CVE-2026-25635 is a path traversal vulnerability in Calibre's CHM (Compiled HTML Help) reader component that allows arbitrary file writes anywhere the user has write permissions. This critical flaw affects Calibre versions prior to 9.2.0 and can lead to Remote Code Execution (RCE) on Windows systems by writing a malicious payload to the Startup folder, which executes automatically on the next user login.
Critical Impact
Attackers can achieve Remote Code Execution by exploiting the CHM reader's path traversal weakness to write malicious files to arbitrary locations, including the Windows Startup folder for persistence.
Affected Products
- Calibre e-book management software versions prior to 9.2.0
- Windows installations are confirmed vulnerable to RCE via Startup folder exploitation
- Linux and macOS installations may also be affected by arbitrary file write (unconfirmed)
Discovery Timeline
- 2026-02-06 - CVE CVE-2026-25635 published to NVD
- 2026-02-11 - Last updated in NVD database
Technical Details for CVE-2026-25635
Vulnerability Analysis
The vulnerability exists in Calibre's CHM file processing functionality, specifically in the src/calibre/ebooks/chm/reader.py module. CHM files are Microsoft's proprietary compiled HTML format commonly used for documentation and help files. When Calibre processes a maliciously crafted CHM file, it fails to properly validate the internal file paths contained within the archive.
The core issue stems from CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), commonly known as path traversal. When extracting files from a CHM archive, the reader component does not adequately sanitize file paths, allowing directory traversal sequences (such as ../) to escape the intended extraction directory. This enables an attacker to write files to arbitrary locations on the filesystem where the user running Calibre has write permissions.
On Windows systems, this vulnerability is particularly severe because attackers can target the user's Startup folder (%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup). Any executable or script placed in this directory will automatically run when the user logs in, providing a reliable path to code execution.
Root Cause
The root cause is insufficient validation of internal file paths when processing CHM archives in the reader.py module. The CHM reader failed to verify that extracted file paths remain within the designated output directory, allowing path traversal sequences to escape containment. The fix introduces proper path validation using the make_long_path_useable utility from calibre.utils.filenames to ensure internal files with paths ending up outside the container are ignored.
Attack Vector
The attack requires local access with user interaction—a victim must open a maliciously crafted CHM file or an e-book containing a malicious CHM component using Calibre. The attacker crafts a CHM file with embedded files that contain path traversal sequences in their names. When processed by Calibre, these files are written to attacker-controlled locations outside the intended directory.
The exploitation flow is:
- Attacker creates a malicious CHM file with path traversal in internal file paths
- Victim opens the malicious file in Calibre (directly or as part of an e-book)
- Calibre extracts the CHM contents, writing the malicious payload to the Startup folder
- On next Windows login, the payload executes with user privileges
from calibre.ebooks.BeautifulSoup import BeautifulSoup, NavigableString
from calibre.ebooks.chardet import xml_to_unicode
from calibre.ebooks.metadata.toc import TOC
+from calibre.utils.filenames import make_long_path_useable
from polyglot.builtins import as_unicode
Source: GitHub Commit Update
The patch adds the make_long_path_useable import which is used to properly sanitize and validate file paths during CHM extraction, ensuring that files with traversal sequences are ignored rather than written to arbitrary locations.
Detection Methods for CVE-2026-25635
Indicators of Compromise
- Unexpected files appearing in the Windows Startup folder (%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup)
- Suspicious executable or script files created in user-writable directories with timestamps correlating to CHM file access
- Calibre process writing files to directories outside its normal working directories
- CHM files containing path traversal sequences (../, ..\) in internal file listings
Detection Strategies
- Monitor file system activity from Calibre processes for writes outside the Calibre library and temp directories
- Implement endpoint detection rules for path traversal patterns in file operations
- Scan incoming CHM files and e-books for malicious path traversal sequences before processing
- Use behavioral analysis to detect unusual file creation in sensitive directories like Startup folders
Monitoring Recommendations
- Enable Windows Security auditing for file creation events in Startup folders
- Configure SentinelOne to alert on Calibre process file writes to %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
- Monitor for newly created executables or scripts in user profile directories with Calibre as the parent process
- Implement file integrity monitoring for critical directories that should not receive files from document readers
How to Mitigate CVE-2026-25635
Immediate Actions Required
- Upgrade Calibre to version 9.2.0 or later immediately
- Avoid opening CHM files from untrusted sources until the upgrade is complete
- Review the Startup folder and user-writable directories for any suspicious files that may have been written
- Consider temporarily disabling CHM import functionality in older Calibre versions if upgrade is delayed
Patch Information
The vulnerability has been fixed in Calibre version 9.2.0. The security patch is available in commit 9739232fcb029ac15dfe52ccd4fdb4a07ebb6ce9 which adds proper path validation to ignore internal CHM files with paths that would resolve outside the intended extraction directory. For detailed information, refer to the GitHub Security Advisory GHSA-32vh-whvh-9fxr and the technical analysis blog post.
Workarounds
- Remove or disable CHM import plugins in Calibre if CHM functionality is not required
- Run Calibre in a sandboxed environment or with restricted file system permissions
- Use application whitelisting to prevent unexpected executables in Startup folders from running
- Implement strict download policies to prevent users from obtaining e-books from untrusted sources
# Configuration example
# On Windows, monitor the Startup folder for unexpected writes
# Set up PowerShell-based monitoring for the Startup directory
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup"
$watcher.EnableRaisingEvents = $true
Register-ObjectEvent $watcher "Created" -Action {
Write-EventLog -LogName Application -Source "Security" -EventId 1001 -Message "New file in Startup: $($Event.SourceEventArgs.FullPath)"
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

