CVE-2022-24859 (GCVE-0-2022-24859)
Vulnerability from cvelistv5
Published
2022-04-18 00:00
Modified
2025-04-22 18:15
CWE
  • CWE-835 - Loop with Unreachable Exit Condition ('Infinite Loop')
Summary
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.
Impacted products
Vendor Product Version
py-pdf PyPDF2 Version: < 1.27.5
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-03T04:20:50.700Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://github.com/py-pdf/PyPDF2/issues/329"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://github.com/py-pdf/PyPDF2/pull/740"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5"
          },
          {
            "name": "[debian-lts-announce] 20220603 [SECURITY] [DLA 3039-1] pypdf2 security update",
            "tags": [
              "mailing-list",
              "x_transferred"
            ],
            "url": "https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html"
          },
          {
            "name": "[debian-lts-announce] 20230609 [SECURITY] [DLA 3451-1] pypdf2 security update",
            "tags": [
              "mailing-list",
              "x_transferred"
            ],
            "url": "https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2022-24859",
                "options": [
                  {
                    "Exploitation": "poc"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2025-04-22T15:48:47.752836Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2025-04-22T18:15:17.460Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "product": "PyPDF2",
          "vendor": "py-pdf",
          "versions": [
            {
              "status": "affected",
              "version": "\u003c 1.27.5"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "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."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "attackComplexity": "LOW",
            "attackVector": "LOCAL",
            "availabilityImpact": "HIGH",
            "baseScore": 6.2,
            "baseSeverity": "MEDIUM",
            "confidentialityImpact": "NONE",
            "integrityImpact": "NONE",
            "privilegesRequired": "NONE",
            "scope": "UNCHANGED",
            "userInteraction": "NONE",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
            "version": "3.1"
          }
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-835",
              "description": "CWE-835: Loop with Unreachable Exit Condition (\u0027Infinite Loop\u0027)",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2023-06-10T00:00:00.000Z",
        "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "shortName": "GitHub_M"
      },
      "references": [
        {
          "url": "https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79"
        },
        {
          "url": "https://github.com/py-pdf/PyPDF2/issues/329"
        },
        {
          "url": "https://github.com/py-pdf/PyPDF2/pull/740"
        },
        {
          "url": "https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5"
        },
        {
          "name": "[debian-lts-announce] 20220603 [SECURITY] [DLA 3039-1] pypdf2 security update",
          "tags": [
            "mailing-list"
          ],
          "url": "https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html"
        },
        {
          "name": "[debian-lts-announce] 20230609 [SECURITY] [DLA 3451-1] pypdf2 security update",
          "tags": [
            "mailing-list"
          ],
          "url": "https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html"
        }
      ],
      "source": {
        "advisory": "GHSA-xcjx-m2pj-8g79",
        "discovery": "UNKNOWN"
      },
      "title": "Manipulated inline images can cause Infinite Loop in PyPDF2"
    }
  },
  "cveMetadata": {
    "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
    "assignerShortName": "GitHub_M",
    "cveId": "CVE-2022-24859",
    "datePublished": "2022-04-18T00:00:00.000Z",
    "dateReserved": "2022-02-10T00:00:00.000Z",
    "dateUpdated": "2025-04-22T18:15:17.460Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-24859\",\"sourceIdentifier\":\"security-advisories@github.com\",\"published\":\"2022-04-18T19:15:09.757\",\"lastModified\":\"2024-11-21T06:51:15.173\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"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.\"},{\"lang\":\"es\",\"value\":\"PyPDF2 es una librer\u00eda PDF de c\u00f3digo abierto capaz de dividir, fusionar, recortar y transformar las p\u00e1ginas de los archivos PDF. En versiones anteriores a 1.27.5 un atacante que use esta vulnerabilidad puede dise\u00f1ar un PDF que conlleva a un bucle infinito si el c\u00f3digo de PyPDF2 intenta conseguir el flujo de contenido. La raz\u00f3n es que el \u00faltimo bucle while en \\\"ContentStream._readInlineImage\\\" s\u00f3lo termina cuando encuentra el token \\\"EI\\\", pero nunca comprueba si el flujo ya ha terminado. Este problema ha sido resuelto en versi\u00f3n \\\"1.27.5\\\". Los usuarios que no puedan actualizarse deber\u00e1n comprobar y PDFs antes de iterar sobre su flujo de contenido\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"security-advisories@github.com\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":6.2,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":2.5,\"impactScore\":3.6},{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"REQUIRED\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}],\"cvssMetricV2\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"2.0\",\"vectorString\":\"AV:N/AC:M/Au:N/C:N/I:N/A:P\",\"baseScore\":4.3,\"accessVector\":\"NETWORK\",\"accessComplexity\":\"MEDIUM\",\"authentication\":\"NONE\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"PARTIAL\"},\"baseSeverity\":\"MEDIUM\",\"exploitabilityScore\":8.6,\"impactScore\":2.9,\"acInsufInfo\":false,\"obtainAllPrivilege\":false,\"obtainUserPrivilege\":false,\"obtainOtherPrivilege\":false,\"userInteractionRequired\":true}]},\"weaknesses\":[{\"source\":\"security-advisories@github.com\",\"type\":\"Secondary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-835\"}]},{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-835\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:a:pypdf2_project:pypdf2:*:*:*:*:*:*:*:*\",\"versionEndExcluding\":\"1.27.5\",\"matchCriteriaId\":\"8A55FA8A-9A2D-4317-9B8E-22112A79840E\"}]}]},{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*\",\"matchCriteriaId\":\"DEECE5FC-CACF-4496-A3E7-164736409252\"}]}]}],\"references\":[{\"url\":\"https://github.com/py-pdf/PyPDF2/issues/329\",\"source\":\"security-advisories@github.com\",\"tags\":[\"Exploit\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/py-pdf/PyPDF2/pull/740\",\"source\":\"security-advisories@github.com\",\"tags\":[\"Patch\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5\",\"source\":\"security-advisories@github.com\",\"tags\":[\"Release Notes\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79\",\"source\":\"security-advisories@github.com\",\"tags\":[\"Exploit\",\"Third Party Advisory\"]},{\"url\":\"https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html\",\"source\":\"security-advisories@github.com\",\"tags\":[\"Mailing List\",\"Third Party Advisory\"]},{\"url\":\"https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html\",\"source\":\"security-advisories@github.com\"},{\"url\":\"https://github.com/py-pdf/PyPDF2/issues/329\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Exploit\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/py-pdf/PyPDF2/pull/740\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Patch\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Release Notes\",\"Third Party Advisory\"]},{\"url\":\"https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Exploit\",\"Third Party Advisory\"]},{\"url\":\"https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\",\"tags\":[\"Mailing List\",\"Third Party Advisory\"]},{\"url\":\"https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}",
    "vulnrichment": {
      "containers": "{\"cna\": {\"title\": \"Manipulated inline images can cause Infinite Loop in PyPDF2\", \"providerMetadata\": {\"orgId\": \"a0819718-46f1-4df5-94e2-005712e83aaa\", \"shortName\": \"GitHub_M\", \"dateUpdated\": \"2023-06-10T00:00:00.000Z\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"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.\"}], \"affected\": [{\"vendor\": \"py-pdf\", \"product\": \"PyPDF2\", \"versions\": [{\"version\": \"\u003c 1.27.5\", \"status\": \"affected\"}]}], \"references\": [{\"url\": \"https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79\"}, {\"url\": \"https://github.com/py-pdf/PyPDF2/issues/329\"}, {\"url\": \"https://github.com/py-pdf/PyPDF2/pull/740\"}, {\"url\": \"https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5\"}, {\"name\": \"[debian-lts-announce] 20220603 [SECURITY] [DLA 3039-1] pypdf2 security update\", \"tags\": [\"mailing-list\"], \"url\": \"https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html\"}, {\"name\": \"[debian-lts-announce] 20230609 [SECURITY] [DLA 3451-1] pypdf2 security update\", \"tags\": [\"mailing-list\"], \"url\": \"https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html\"}], \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.1\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H\", \"attackVector\": \"LOCAL\", \"attackComplexity\": \"LOW\", \"privilegesRequired\": \"NONE\", \"userInteraction\": \"NONE\", \"scope\": \"UNCHANGED\", \"confidentialityImpact\": \"NONE\", \"integrityImpact\": \"NONE\", \"availabilityImpact\": \"HIGH\", \"baseScore\": 6.2, \"baseSeverity\": \"MEDIUM\"}}], \"problemTypes\": [{\"descriptions\": [{\"type\": \"CWE\", \"lang\": \"en\", \"description\": \"CWE-835: Loop with Unreachable Exit Condition (\u0027Infinite Loop\u0027)\", \"cweId\": \"CWE-835\"}]}], \"source\": {\"advisory\": \"GHSA-xcjx-m2pj-8g79\", \"discovery\": \"UNKNOWN\"}}, \"adp\": [{\"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-03T04:20:50.700Z\"}, \"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://github.com/py-pdf/PyPDF2/security/advisories/GHSA-xcjx-m2pj-8g79\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://github.com/py-pdf/PyPDF2/issues/329\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://github.com/py-pdf/PyPDF2/pull/740\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://github.com/py-pdf/PyPDF2/releases/tag/1.27.5\", \"tags\": [\"x_transferred\"]}, {\"name\": \"[debian-lts-announce] 20220603 [SECURITY] [DLA 3039-1] pypdf2 security update\", \"tags\": [\"mailing-list\", \"x_transferred\"], \"url\": \"https://lists.debian.org/debian-lts-announce/2022/06/msg00001.html\"}, {\"name\": \"[debian-lts-announce] 20230609 [SECURITY] [DLA 3451-1] pypdf2 security update\", \"tags\": [\"mailing-list\", \"x_transferred\"], \"url\": \"https://lists.debian.org/debian-lts-announce/2023/06/msg00013.html\"}]}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2022-24859\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"poc\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2025-04-22T15:48:47.752836Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2025-04-22T15:48:49.824Z\"}}]}",
      "cveMetadata": "{\"state\": \"PUBLISHED\", \"cveId\": \"CVE-2022-24859\", \"assignerOrgId\": \"a0819718-46f1-4df5-94e2-005712e83aaa\", \"assignerShortName\": \"GitHub_M\", \"dateUpdated\": \"2025-04-22T18:15:17.460Z\", \"dateReserved\": \"2022-02-10T00:00:00.000Z\", \"datePublished\": \"2022-04-18T00:00:00.000Z\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…