CVE-2026-73248 in calibreinfo

Summary

by MITRE • 08/12/2026

calibre is an e-book manager. Prior to 9.12.0, calibre processes attacker-controlled composite_template metadata from a malicious EPUB, OPF, PDF, or similar file through program: and a nested template() call whose formatter does not inherit allow_python_templates=False, allowing a nested python: template to reach compile_python_template and execute arbitrary Python code when the file is opened or imported. This issue is fixed in version 9.12.0.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 08/12/2026

The vulnerability in calibre versions prior to 9.12.0 represents a critical remote code execution flaw that arises from insufficient input validation and template processing controls within the application's metadata handling system. This issue specifically affects how calibre processes composite_template metadata from various document formats including EPUB, OPF, and PDF files, creating an attack surface where malicious actors can inject and execute arbitrary Python code through carefully crafted metadata fields.

The technical flaw stems from a design oversight in the template processing pipeline where nested template() calls do not properly enforce the allow_python_templates=False restriction. When calibre encounters attacker-controlled metadata containing program: directives within composite_template structures, the system fails to prevent the execution context from inheriting the necessary security constraints that would normally block Python template execution. This allows a nested python: template directive to bypass initial security checks and reach the compile_python_template function, where it can be executed with the privileges of the user running calibre.

The operational impact of this vulnerability is severe as it enables remote code execution without any user interaction beyond opening or importing the malicious file. Attackers can craft EPUB, OPF, PDF, or similar files containing malicious metadata that, when processed by vulnerable calibre versions, will execute arbitrary Python commands on the victim's system. This creates a significant threat vector for attackers seeking to compromise systems running affected calibre versions, particularly in environments where users frequently open or import documents from untrusted sources.

This vulnerability maps to CWE-94, which specifically addresses "Improper Control of Generation of Code ('Code Injection')" and aligns with ATT&CK technique T1059.001 for Command and Scripting Interpreter. The flaw demonstrates a classic code injection vulnerability where attacker-controlled data flows through multiple processing layers without proper sanitization or security context enforcement, allowing the execution of unintended commands within the application's runtime environment.

Mitigation strategies should focus on immediate patch deployment to version 9.12.0 which addresses the core issue by properly enforcing template security constraints and preventing nested Python template execution from bypassing safety checks. Organizations should also implement strict file validation policies, disable automatic import of untrusted documents, and consider network-level restrictions on document file types that may contain problematic metadata structures. Additionally, users should be educated about the risks of opening documents from unknown or untrusted sources to reduce the likelihood of successful exploitation attempts.

Responsible

GitHub M

Reservation

08/11/2026

Disclosure

08/12/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!