CVE-2025-62707: Pypdf Pypdf Possibly Loops Infinitely When Vulnerability
MODERATECVE-2025-62707 is a MODERATE pypdf possibly loops infinitely when vulnerability (CWE-834: Excessive Iteration) affecting Pypdf libraries in the PyPI ecosystem. The issue involves pypdf possibly loops infinitely when reading dct inline images without eof marker. Remediation is available by upgrading affected packages to version 6.1.3.
CVE-2025-62707 at a Glance
How to Fix CVE-2025-62707
To remediate this vulnerability, upgrade all affected Pypdf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install pypdf>=6.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show pypdf
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-62707, inspect your installed packages using pip:
pip show pypdf
Analyze the terminal output to locate any version of Pypdf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.1.3), your application is affected.
Note: The pip show pypdf command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-834: Excessive Iteration, where the product performs an iteration or loop without sufficiently limiting the number of times that the loop is executed. In Pypdf, 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
CVE-2025-62707 Affected Pypdf Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pypdf
|
PyPI |
< 6.1.3
|
6.1.3
|
References
Frequently Asked Questions
What is CVE-2025-62707?
Which Pypdf versions are affected?
What version fixes CVE-2025-62707?
Is pypdf affected?
What CWE is associated with CVE-2025-62707?
How can I check PyPI dependencies for CVE-2025-62707?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vr63-x8vc-m265",
"modified" : "2025-10-23T17:40:35Z",
"published" : "2025-10-22T19:40:47Z",
"aliases" : [ "CVE-2025-62707" ],
"summary" : "pypdf possibly loops infinitely when reading DCT inline images without EOF marker",
"details" : "### Impact\n\nAn attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires parsing the content stream of a page which has an inline image using the DCTDecode filter.\n\n### Patches\nThis has been fixed in [pypdf==6.1.3](https://github.com/py-pdf/pypdf/releases/tag/6.1.3).\n\n### Workarounds\nIf you cannot upgrade yet, consider applying the changes from PR [#3501](https://github.com/py-pdf/pypdf/pull/3501).",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pypdf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.1.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/py-pdf/pypdf/security/advisories/GHSA-vr63-x8vc-m265"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-62707"
}, {
"type" : "WEB",
"url" : "https://github.com/py-pdf/pypdf/pull/3501"
}, {
"type" : "WEB",
"url" : "https://github.com/py-pdf/pypdf/commit/f2864d6dd9bac7cecd3f4f54308b25ebbfa178f8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/py-pdf/pypdf"
}, {
"type" : "WEB",
"url" : "https://github.com/py-pdf/pypdf/releases/tag/6.1.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-834" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-10-22T19:40:47Z",
"nvd_published_at" : "2025-10-22T22:15:35Z"
}
}