Junglewise Threat Intelligence

CVE-2025-26240: JazzCore python-pdfkit command injection via HTML meta tags

CVE-2025-26240 · Severity: high · CVSS 8.4 · Published 2026-06-17

Vendors: PyPI.

Executive brief

A vulnerability in the python-pdfkit library, which converts HTML to PDF documents, allows attackers to execute unauthorized commands on the server. By providing specially crafted HTML content, an attacker can force the application to leak sensitive system files or perform unauthorized network requests. This could lead to the exposure of confidential data or provide a foothold for further attacks on the internal network.

Technical details

A vulnerability in JazzCore python-pdfkit 1.0.0's `from_string` method stems from improper validation of HTML meta tags. The `_find_options_in_meta` function parses tags starting with 'pdfkit-' and converts them into command-line arguments for the underlying `wkhtmltopdf` binary. An attacker can inject dangerous flags such as `--post-file` or `--enable-local-file-access` to exfiltrate local files (e.g., /etc/passwd) or `--script` to execute JavaScript, leading to SSRF. Furthermore, the library's use of Python's `OrderedDict.update()` allows attackers to override security options set by developers by manipulating the order of arguments. As a workaround, developers are advised to use the `from_file` method, which does not parse meta tags.

Affected products

  • JazzCore python-pdfkit 1.0.0

Timeline

  • 2025-03-12: disclosed: Initial discovery and PoC published by Habuon
  • 2026-06-17: advisory: CVE-2025-26240 published to NVD

References