Skip to content

Security Concerns (CVE-2025-26240) #267

Open

Description

@Habuon

I was wondering whether this library is still in use or maintained at all.
I looked into its functionality and found that the from_string method is extremely dangerous, and I haven't seen any warnings about using the from_string with untrusted HTML.

Activity

  1. Habuon commented on Mar 18, 2025

    @Habuon
    Author

    The vulnerability has been assigned a CVE ID CVE-2025-26240.
    Simple proof of concept for the vulnerability is available on my github repository: https://github.com/Habuon/CVE-2025-26240
    Also more details on it are available on my github blog: https://habuon.github.io/2025/03/12/pdfkit-vulnerability-(CVE-2025-26240).html

    Short Summary of the Vulnerability

    The vulnerability is caused by parsing user-provided HTML in the from_string method, with no available options to mitigate the risk. The from_string method uses meta tags whose names start with “pdfkit-” and treats their values as command-line parameters for the wkhtmltopdf tool. This parsing is performed in the _find_options_in_meta method, located in the pdfkit/pdfkit.py file. While this functionality may be useful for certain use cases (such as setting the paper size), some wkhtmltopdf arguments pose security risks.

  2. changed the title [-]Security Concerns[/-] [+]Security Concerns (CVE-2025-26240)[/+] on Mar 18, 2025
  3. sleepyGao commented on Jul 12, 2026

    @sleepyGao

    check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions