CVE-2025-26240: pdfkit Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-9g3x-6x24-vf9f
CVSS 8.4
CWE-120 CWE-22
Published
Advisory Summary

CVE-2025-26240 is a HIGH (CVSS 8.4) path traversal vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting pdfkit libraries in the PyPI ecosystem. The issue involves path traversal in from_string. Remediation is available in the latest vendor maintenance releases.

CVE-2025-26240 at a Glance

CVE Identifier CVE-2025-26240
GHSA Identifier GHSA-9g3x-6x24-vf9f
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Affected Product pdfkit
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-26240

To remediate this vulnerability, upgrade all affected pdfkit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pdfkit fixed: Latest secure release
pip install pdfkit>=Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pdfkit

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-26240, inspect your installed packages using pip:

pip show pdfkit

Analyze the terminal output to locate any version of pdfkit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The pip show pdfkit command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. In pdfkit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

In JazzCore python-pdfkit 1.0.0, the from_string method enables the execution of JavaScript code within the context of the server application and the exfiltration of local files.

CVE-2025-26240 Affected pdfkit Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
pdfkit
PyPI
≤ 1.0.0

References

Frequently Asked Questions

What is CVE-2025-26240?
CVE-2025-26240 is a security vulnerability in pdfkit involving Path traversal in from_string under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow').
Which pdfkit versions are affected?
Affected versions include releases prior to current release patches across affected packages: pdfkit.
What version fixes CVE-2025-26240?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is pdfkit affected?
Yes, pdfkit is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2025-26240?
CVE-2025-26240 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2025-26240?
CVE-2025-26240 is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') (The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer.).
How can I check PyPI dependencies for CVE-2025-26240?
Run the dependency tree command: 'pip show pdfkit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9g3x-6x24-vf9f",
  "modified" : "2026-06-18T14:38:10Z",
  "published" : "2026-06-17T18:35:56Z",
  "aliases" : [ "CVE-2025-26240" ],
  "summary" : "pdfkit: Path traversal in from_string",
  "details" : "In JazzCore python-pdfkit 1.0.0, the from_string method enables the execution of JavaScript code within the context of the server application and the exfiltration of local files.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pdfkit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-26240"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/JazzCore/python-pdfkit"
  }, {
    "type" : "WEB",
    "url" : "https://habuon.github.io/2025/03/12/pdfkit-vulnerability-%28CVE-2025-26240%29.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.csirt.gov.sk/the-python-pdfkit-library-vulnerability.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-120", "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-18T14:38:10Z",
    "nvd_published_at" : "2026-06-17T17:16:38Z"
  }
}