pypdf is a free and open-source pure-python PDF library. Prior to 6.13.0, an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires merging a file with outlines into a writer. This vulnerability is fixed in 6.13.0.
PUBLISHED5.2CWE-835
pypdf: Possible infinite loop when processing outlines/bookmarks in writer
Problem type
Affected products
py-pdf
pypdf
< 6.13.0 - AFFECTED
References
https://github.com/py-pdf/pypdf/security/advisories/GHSA-m2v9-299j-rv96
https://github.com/py-pdf/pypdf/security/advisories/GHSA-m2v9-299j-rv96
https://github.com/py-pdf/pypdf/pull/3830
https://github.com/py-pdf/pypdf/pull/3830
https://github.com/py-pdf/pypdf/releases/tag/6.13.0
https://github.com/py-pdf/pypdf/releases/tag/6.13.0
GitHub Security Advisories
GHSA-m2v9-299j-rv96
pypdf: Possible infinite loop when processing outlines/bookmarks in writer
https://github.com/advisories/GHSA-m2v9-299j-rv96Impact
An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires merging a file with outlines into a writer.
Patches
This has been fixed in pypdf==6.13.0.
Workarounds
If you cannot upgrade yet, consider applying the changes from PR #3830.
JSON source
https://cveawg.mitre.org/api/cve/CVE-2026-54531Click to expand
{
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"cveMetadata": {
"cveId": "CVE-2026-54531",
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"assignerShortName": "GitHub_M",
"dateUpdated": "2026-06-22T20:26:19.756Z",
"dateReserved": "2026-06-15T18:40:01.651Z",
"datePublished": "2026-06-22T20:26:19.756Z",
"state": "PUBLISHED"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M",
"dateUpdated": "2026-06-22T20:26:19.756Z"
},
"title": "pypdf: Possible infinite loop when processing outlines/bookmarks in writer",
"descriptions": [
{
"lang": "en",
"value": "pypdf is a free and open-source pure-python PDF library. Prior to 6.13.0, an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop. This requires merging a file with outlines into a writer. This vulnerability is fixed in 6.13.0."
}
],
"affected": [
{
"vendor": "py-pdf",
"product": "pypdf",
"versions": [
{
"version": "< 6.13.0",
"status": "affected"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"lang": "en",
"description": "CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')",
"cweId": "CWE-835",
"type": "CWE"
}
]
}
],
"references": [
{
"url": "https://github.com/py-pdf/pypdf/security/advisories/GHSA-m2v9-299j-rv96",
"name": "https://github.com/py-pdf/pypdf/security/advisories/GHSA-m2v9-299j-rv96",
"tags": [
"x_refsource_CONFIRM"
]
},
{
"url": "https://github.com/py-pdf/pypdf/pull/3830",
"name": "https://github.com/py-pdf/pypdf/pull/3830",
"tags": [
"x_refsource_MISC"
]
},
{
"url": "https://github.com/py-pdf/pypdf/releases/tag/6.13.0",
"name": "https://github.com/py-pdf/pypdf/releases/tag/6.13.0",
"tags": [
"x_refsource_MISC"
]
}
],
"metrics": [
{}
]
}
}
}