Every CVE Search/ Get API key

CVE-2026-31826

pypdf: manipulated stream length values can exhaust RAM

6.8 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
Passive

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

0.20%Up 0.2 points since Mar 11, 2026
90%50%10%1%

What each source reports

CVE List Score used 6.8

pypdf: manipulated stream length values can exhaust RAM

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.

Record
CVE-2026-31826
CVSS 4.0
6.8 MediumCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-770
Updated
2026-11-02
EUVDEUVD-2026-10924 6.8

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.

Record
EUVD-2026-10924
CVSS 4.0
6.8 MediumCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-hqmh-ppp3-xvm7 6.8

pypdf: manipulated stream length values can exhaust RAM

Impact

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.

Patches

This has been fixed in pypdf==6.8.0.

Workarounds

If you cannot upgrade yet, consider applying the changes from PR #3675.

As 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.

Record
GHSA-hqmh-ppp3-xvm7
CVSS 4.0
6.8 MediumCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-770
Updated
2026-11-02
NVD 6.8

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.

Record
CVE-2026-31826
CVSS 4.0
6.8 MediumCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-770
Updated
2026-11-02
OSV 6.8

pypdf: manipulated stream length values can exhaust RAM

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.

Record
CVE-2026-31826
CVSS 4.0
6.8 MediumCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-770
Updated
2026-11-04
OSVDEBIAN-CVE-2026-31826 5.5

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.

Record
DEBIAN-CVE-2026-31826
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-03
Show 8 moreShow less
OSVGHSA-hqmh-ppp3-xvm7 6.8

pypdf: manipulated stream length values can exhaust RAM

Impact

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.

Patches

This has been fixed in pypdf==6.8.0.

Workarounds

If you cannot upgrade yet, consider applying the changes from PR #3675.

As 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.

Record
GHSA-hqmh-ppp3-xvm7
CVSS 4.0
6.8 MediumCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-770
Updated
2026-11-02
OSVPYSEC-2026-3019 6.8

pypdf: manipulated stream length values can exhaust RAM

Impact

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.

Patches

This has been fixed in pypdf==6.8.0.

Workarounds

If you cannot upgrade yet, consider applying the changes from PR #3675.

As 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.

Record
PYSEC-2026-3019
CVSS 4.0
6.8 MediumCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Updated
2026-11-02
OSVUBUNTU-CVE-2026-31826 6.8

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.

Record
UBUNTU-CVE-2026-31826
CVSS 4.0
6.8 MediumCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVCLSA-2026-1786946462 No score

TuxCare security update for pypdf (6 CVEs)

TuxCare rebuilt pypdf to address 6 CVEs. Fixed in 5.9.0.post12+tuxcare.

Record
CLSA-2026-1786946462
Updated
2026-11-02
OSVopenSUSE-SU-2026:10332-1 No score

python311-PyPDF2-2.11.1-7.1 on GA media

These are all security issues fixed in the python311-PyPDF2-2.11.1-7.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:10332-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:10334-1 No score

python311-pypdf-6.8.0-1.1 on GA media

These are all security issues fixed in the python311-pypdf-6.8.0-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:10334-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:20375-1 No score

Security update for python-PyPDF2

This update for python-PyPDF2 fixes the following issues:

Changes in python-PyPDF2:

  • CVE-2025-31826: Fixed denial of service due to excessive memory consumption via crafted PDF (bsc#1259508).
Record
openSUSE-SU-2026:20375-1
Updated
2026-11-02
OSVROOT-APP-PYPI-CVE-2026-31826 No score

CVE-2026-31826 in pypdf - Patched by Root

Root has patched CVE-2026-31826 in the pypdf package for Root:PyPI. Multiple fixed versions available.

Record
ROOT-APP-PYPI-CVE-2026-31826
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
pypdf
PyPI
before 6.8.0
6.8.0
pypdf
TuxCare:PyPI
From an advisory covering 5 CVEs
5.9.0 up to 5.9.0.post12+tuxcare, plus listed versions
5.9.0.post1+tuxcare5.9.0.post10+tuxcare5.9.0.post11+tuxcare5.9.0.post2+tuxcare5.9.0.post3+tuxcare
Show 6 moreShow less
5.9.0.post4+tuxcare5.9.0.post5+tuxcare5.9.0.post6+tuxcare5.9.0.post7+tuxcare5.9.0.post8+tuxcare5.9.0.post9+tuxcare
5.9.0.post12+tuxcare
pypdf
Debian:12
All versions, plus listed versions
3.17.4-13.4.1-13.4.1-1+deb12u14.0.0-14.0.0-1~exp1
Show 13 moreShow less
4.0.1-14.0.2-14.1.0-14.2.0-14.3.1-15.4.0-16.19.0-16.21.0-16.21.1-16.21.4-16.9.0-16.9.2-16.9.2-2
None known
pypdf
Debian:13
All versions, plus listed versions
5.4.0-16.19.0-16.21.0-16.21.1-16.21.4-16.9.0-16.9.2-16.9.2-2
None known
pypdf
Debian:14
before 6.9.0-1, plus listed versions
5.4.0-1
6.9.0-1
pypdf2
Debian:12
All versions, plus listed versions
2.12.1-32.12.1-3+deb12u12.12.1-4
None known
pypdf
PyPI
before 6.8.0, plus listed versions
1.01.11.101.111.12
Show 45 moreShow less
1.131.21.31.41.51.61.71.81.93.1.03.10.03.11.03.11.13.12.03.12.13.12.23.13.03.14.03.15.03.15.13.15.23.15.33.15.43.15.53.16.03.16.13.16.23.16.33.16.43.17.03.17.13.17.23.17.33.17.43.2.03.2.13.3.03.4.03.4.13.5.03.5.13.5.23.6.03.7.03.7.1
6.8.0
pypdf
Root:PyPI
before 6.6.0+aikido.7
6.6.0+aikido.76.6.0+aikido.86.6.0+aikido.96.6.0+aikido.106.6.0+aikido.116.6.0+aikido.126.6.0+aikido.136.6.0+aikido.146.6.0+aikido.15
rootio-pypdf
Root:PyPI
before 6.6.0+root.io.5
6.6.0+root.io.56.6.0+root.io.66.6.0+root.io.76.6.0+root.io.86.6.0+root.io.96.6.0+root.io.106.6.0+root.io.11
pypdf
Ubuntu:24.04:LTS
All versions, plus listed versions
3.4.1-13.17.4-14.0.0-14.0.1-14.0.2-1
None known
Show 5 moreShow less
Affected packages
PackageAffectedFixed
pypdf
Ubuntu:25.10
All versions, plus listed versions
4.3.1-15.4.0-1
None known
pypdf
Ubuntu:26.10
All versions, plus listed versions
6.9.2-16.9.2-2
None known
pypdf
Ubuntu:26.04:LTS
All versions, plus listed versions
5.4.0-16.9.2-1
None known
python-PyPDF2
openSUSE:Tumbleweed
before 2.11.1-7.1
2.11.1-7.1
python-pypdf
openSUSE:Tumbleweed
before 6.8.0-1.1
6.8.0-1.1

History

History
RecordedChangedSources
affected
factsOSV
affectedOSV
affected
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-31826 is a medium vulnerability (CVSS 6.8) in Py-pdf Pypdf, published March 10, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.20%, the 9th percentile. Fixed in pypdf 6.8.0.

References

Show 8 moreShow less
This page doesn't list everything

Left out here: 44 versions. The JSON record has them.

MoveEnter Open