{"id":"CVE-2026-31826","aliases":["CVE-2026-31826","GHSA-hqmh-ppp3-xvm7","PYSEC-2026-3019"],"related":[],"kind":"vulnerability","state":"published","title":"pypdf: manipulated stream length values can exhaust RAM","summary":"pypdf is a free and open-source pure-python PDF library. Prior to 6.8.0, an 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. This vulnerability is fixed in 6.8.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"pypdf is a free and open-source pure-python PDF library. Prior to 6.8.0, an 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. This vulnerability is fixed in 6.8.0.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"pypdf es una biblioteca PDF pura de Python, gratuita y de código abierto. Antes de la 6.8.0, un atacante que explota esta vulnerabilidad puede crear un PDF que provoca un gran consumo de memoria. Esto requiere analizar una secuencia de contenido con un valor /Length bastante grande, independientemente de la longitud real de los datos dentro de la secuencia. Esta vulnerabilidad está corregida en la 6.8.0.","source":"nvd"}],"published":"2026-03-10T21:36:52.186Z","modified":"2026-11-02T16:06:04.477Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 6.8.0","status":"affected"}],"vendor":"py-pdf","product":"pypdf","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.8.0"}],"ecosystem":"PyPI","package":"pypdf","purl":"pkg:pypi/pypdf","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"6.8.0"}],"vendor":"py-pdf","product":"pypdf","cpe":"cpe:2.3:a:py-pdf:pypdf:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.8.0"}],"ecosystem":"PyPI","package":"pypdf","purl":"pkg:pypi/pypdf","source":"pysec"}],"references":[{"url":"https://github.com/py-pdf/pypdf/security/advisories/GHSA-hqmh-ppp3-xvm7","tags":["patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/py-pdf/pypdf/pull/3675","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/py-pdf/pypdf/releases/tag/6.8.0","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31826","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/py-pdf/pypdf/commit/3c550b3196adeba1506a26e57c09c09fac75e9aa","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/py-pdf/pypdf","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/pypdf","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-hqmh-ppp3-xvm7","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-03-11T15:51:55.234Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31826","url":"https://www.cve.org/CVERecord?id=CVE-2026-31826","licence":"CVE Terms of Use","modified":"2026-03-11T15:59:26.902Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hqmh-ppp3-xvm7","url":"https://github.com/advisories/GHSA-hqmh-ppp3-xvm7","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:39.503Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31826","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31826","licence":"Public domain","modified":"2026-11-02T16:06:04.477Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3019","url":"https://osv.dev/vulnerability/PYSEC-2026-3019","licence":"CC-BY-4.0","modified":"2026-07-13T16:33:05.714Z"}],"updatedAt":"2026-11-25T22:59:15.679Z","epss":{"score":0.002,"percentile":0.10459,"date":"2026-12-01T12:00:22.000Z"}}