CVE-2026-73248: CWE-94: Improper Control of Generation of Code ('Code Injection') in kovidgoyal calibre
A code injection vulnerability exists in calibre before version 9.12.0. The flaw allows attacker-controlled composite_template metadata in malicious e-book files to execute arbitrary Python code when opened or imported. This occurs because nested python: templates can bypass the intended restriction on Python code execution. The issue is fixed in calibre 9.12.0.
AI Analysis
Technical Summary
calibre versions prior to 9.12.0 improperly control the generation of code via composite_template metadata in EPUB, OPF, PDF, or similar files. Specifically, a nested python: template call can reach compile_python_template without inheriting the allow_python_templates=False restriction, enabling arbitrary Python code execution upon file open or import. This vulnerability is classified as CWE-94 (Improper Control of Generation of Code) and CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code).
Potential Impact
An attacker who can supply a crafted e-book file can execute arbitrary Python code on the victim's system when the file is opened or imported in vulnerable calibre versions. This can lead to full compromise of the user's environment with the privileges of the calibre process. The CVSS 4.0 score is 8.5 (high severity), reflecting local attack vector with low complexity, no privileges required, but requiring user interaction.
Mitigation Recommendations
Upgrade calibre to version 9.12.0 or later, where this vulnerability is fixed. No other mitigation is indicated or required by the vendor advisory. Patch status is confirmed fixed in 9.12.0.
CVE-2026-73248: CWE-94: Improper Control of Generation of Code ('Code Injection') in kovidgoyal calibre
Description
A code injection vulnerability exists in calibre before version 9.12.0. The flaw allows attacker-controlled composite_template metadata in malicious e-book files to execute arbitrary Python code when opened or imported. This occurs because nested python: templates can bypass the intended restriction on Python code execution. The issue is fixed in calibre 9.12.0.
CVSS v4.0
Score 8.5high
Affected software
pkg:github/kovidgoyal/calibreRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
calibre versions prior to 9.12.0 improperly control the generation of code via composite_template metadata in EPUB, OPF, PDF, or similar files. Specifically, a nested python: template call can reach compile_python_template without inheriting the allow_python_templates=False restriction, enabling arbitrary Python code execution upon file open or import. This vulnerability is classified as CWE-94 (Improper Control of Generation of Code) and CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code).
Potential Impact
An attacker who can supply a crafted e-book file can execute arbitrary Python code on the victim's system when the file is opened or imported in vulnerable calibre versions. This can lead to full compromise of the user's environment with the privileges of the calibre process. The CVSS 4.0 score is 8.5 (high severity), reflecting local attack vector with low complexity, no privileges required, but requiring user interaction.
Mitigation Recommendations
Upgrade calibre to version 9.12.0 or later, where this vulnerability is fixed. No other mitigation is indicated or required by the vendor advisory. Patch status is confirmed fixed in 9.12.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-08-11T17:18:01.597Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a7b9e69bf8831d5397e8732
Added to database: 08/11/2026, 22:12:57 UTC
Last enriched: 08/11/2026, 22:26:11 UTC
Last updated: 08/12/2026, 02:01:16 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.