GHSA-xcjx-m2pj-8g79

Suggest an improvement
Source
https://github.com/advisories/GHSA-xcjx-m2pj-8g79
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/04/GHSA-xcjx-m2pj-8g79/GHSA-xcjx-m2pj-8g79.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-xcjx-m2pj-8g79
Aliases
Published
2022-04-22T20:54:41Z
Modified
2024-10-14T18:55:47.089530Z
Severity
  • 6.2 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
  • 6.9 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
Manipulated inline images can cause Infinite Loop in PyPDF2
Details

Impact

An attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if the PyPDF2 user wrote the following code:

from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import ContentStream

reader = PdfFileReader("malicious.pdf", strict=False)
for page in reader.pages:
    ContentStream(page.getContents(), reader)

Patches

PyPDF2==1.27.5 and later are patched.

Credits to Sebastian Krause for finding (issue) and fixing (PR) it.

References

Affected packages

PyPI / pypdf2

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.27.5

Affected versions

1.*

1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.25.1
1.26.0
1.27.0
1.27.1
1.27.2
1.27.3
1.27.4