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.test.osv.dev/v1/vulns/GHSA-xcjx-m2pj-8g79
Aliases
Published
2022-04-22T20:54:41Z
Modified
2024-10-14T18:30:12.021140Z
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.

Database specific
{
    "nvd_published_at": "2022-04-18T19:15:00Z",
    "cwe_ids": [
        "CWE-835"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2022-04-22T20:54:41Z"
}
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