---
id: CVE-2026-113791
title: 'pypdf: Possible large memory usage when parsing content streams'
summary: >-
  pypdf is a free and open-source pure-python PDF library. Prior to 6.21.0, an
  attacker can craft a PDF containing a content stream with many small
  operations, causing parsing to consume large amounts of memory. This issue is
  fixed in vers…
severity: medium
cvss: 6
cvssVector: 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'
cvssSource: cna
cwe:
  - CWE-400
  - CWE-770
vendor: py-pdf
product: pypdf
affected:
  - pypdf < 6.21.0
published: '2026-10-21'
updated: '2026-10-21'
sourceUpdated: '2026-10-21T15:37:50.527Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-113791'
references:
  - url: 'https://github.com/py-pdf/pypdf/security/advisories/GHSA-cgf9-327m-v77c'
    label: 'https://github.com/py-pdf/pypdf/security/advisories/GHSA-cgf9-327m-v77c'
  - url: 'https://github.com/py-pdf/pypdf/pull/4218'
    label: 'https://github.com/py-pdf/pypdf/pull/4218'
  - url: >-
      https://github.com/py-pdf/pypdf/commit/18bd2981a74479483a0b9507602c58a63d6c9b12
    label: >-
      https://github.com/py-pdf/pypdf/commit/18bd2981a74479483a0b9507602c58a63d6c9b12
  - url: 'https://github.com/py-pdf/pypdf/releases/tag/6.21.0'
    label: 'https://github.com/py-pdf/pypdf/releases/tag/6.21.0'
tags:
  - cve.org
ingestedAt: '2026-10-21T16:05:17.697Z'
---

## Overview

pypdf is a free and open-source pure-python PDF library. Prior to 6.21.0, an attacker can craft a PDF containing a content stream with many small operations, causing parsing to consume large amounts of memory. This issue is fixed in version 6.21.0.

## Affected

- `pypdf < 6.21.0`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
