{"id":"PYSEC-2026-3019","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.","aliases":["CVE-2026-31826","GHSA-hqmh-ppp3-xvm7"],"modified":"2026-07-13T16:33:05.714514380Z","published":"2026-07-13T14:36:42.160674Z","references":[{"type":"WEB","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":"WEB","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"},{"type":"WEB","url":"https://github.com/py-pdf/pypdf/releases/tag/6.8.0"},{"type":"PACKAGE","url":"https://pypi.org/project/pypdf"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-hqmh-ppp3-xvm7"}],"affected":[{"package":{"name":"pypdf","ecosystem":"PyPI","purl":"pkg:pypi/pypdf"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.8.0"}]}],"versions":["1.0","1.1","1.10","1.11","1.12","1.13","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.9","3.1.0","3.10.0","3.11.0","3.11.1","3.12.0","3.12.1","3.12.2","3.13.0","3.14.0","3.15.0","3.15.1","3.15.2","3.15.3","3.15.4","3.15.5","3.16.0","3.16.1","3.16.2","3.16.3","3.16.4","3.17.0","3.17.1","3.17.2","3.17.3","3.17.4","3.2.0","3.2.1","3.3.0","3.4.0","3.4.1","3.5.0","3.5.1","3.5.2","3.6.0","3.7.0","3.7.1","3.8.0","3.8.1","3.9.0","3.9.1","4.0.0","4.0.1","4.0.2","4.1.0","4.2.0","4.3.0","4.3.1","5.0.0","5.0.1","5.1.0","5.2.0","5.3.0","5.3.1","5.4.0","5.5.0","5.6.0","5.6.1","5.7.0","5.8.0","5.9.0","6.0.0","6.1.0","6.1.1","6.1.2","6.1.3","6.2.0","6.3.0","6.4.0","6.4.1","6.4.2","6.5.0","6.6.0","6.6.1","6.6.2","6.7.0","6.7.1","6.7.2","6.7.3","6.7.4","6.7.5"],"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/pypdf/PYSEC-2026-3019.yaml"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"}]}