Loop with Unreachable Exit Condition ('Infinite Loop') Affecting pypdf2 package, versions <1.26.0-2+deb9u1


Severity

Recommended
0.0
medium
0
10

Snyk's Security Team recommends NVD's CVSS assessment. Learn more

Threat Intelligence

EPSS
0.08% (37th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-DEBIAN9-PYPDF2-2767222
  • published19 Apr 2022
  • disclosed18 Apr 2022

Introduced: 18 Apr 2022

CVE-2022-24859  (opens in a new tab)
CWE-835  (opens in a new tab)

How to fix?

Upgrade Debian:9 pypdf2 to version 1.26.0-2+deb9u1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream pypdf2 package and not the pypdf2 package as distributed by Debian. See How to fix? for Debian:9 relevant fixed versions and status.

PyPDF2 is an open source python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. In versions prior to 1.27.5 an attacker who uses this vulnerability can craft a PDF which leads to an infinite loop if the PyPDF2 if the code attempts to get the content stream. The reason is that the last while-loop in ContentStream._readInlineImage only terminates when it finds the EI token, but never actually checks if the stream has already ended. This issue has been resolved in version 1.27.5. Users unable to upgrade should validate and PDFs prior to iterating over their content stream.

CVSS Scores

version 3.1