{"id":"CVE-2026-31826","aliases":["GHSA-hqmh-ppp3-xvm7","PYSEC-2026-3019"],"url":"https://o3.security/vulnerability/CVE-2026-31826","summary":"pypdf: manipulated stream length values can exhaust RAM","details":"### Impact\n\nAn attacker who uses this vulnerability can craft a PDF which leads to large memory usage. This requires parsing a content stream with a rather large `/Length` value, regardless of the actual data length inside the stream.\n\n### Patches\nThis has been fixed in [pypdf==6.8.0](https://github.com/py-pdf/pypdf/releases/tag/6.8.0).\n\n### Workarounds\nIf you cannot upgrade yet, consider applying the changes from PR [#3675](https://github.com/py-pdf/pypdf/pull/3675).\n\nAs far as we are aware, this mostly affects reading from buffers of unknown size, as returned by `open(\"file.pdf\", mode=\"rb\")` for example. Passing a file path or a `BytesIO` buffer to *pypdf* instead does not seem to trigger the vulnerability.","published":"2026-03-10T21:36:52.186Z","modified":"2026-08-27T14:10:52.196580575Z","cvss":null,"epss":{"score":0.00172,"percentile":0.06653,"asOf":"2026-08-25"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"pypdf","fixedVersion":"6.8.0"}],"fix":{"url":"https://github.com/py-pdf/pypdf/pull/3675","label":"py-pdf/pypdf#3675"},"references":[{"type":"WEB","url":"https://github.com/py-pdf/pypdf/releases/tag/6.8.0"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31826.json"},{"type":"ADVISORY","url":"https://github.com/py-pdf/pypdf/security/advisories/GHSA-hqmh-ppp3-xvm7"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31826"},{"type":"FIX","url":"https://github.com/py-pdf/pypdf/pull/3675"},{"type":"WEB","url":"https://github.com/py-pdf/pypdf/commit/3c550b3196adeba1506a26e57c09c09fac75e9aa"},{"type":"PACKAGE","url":"https://github.com/py-pdf/pypdf"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-27T14:10:52.196580575Z"}}