pypi / pypdf
pypdf
What changed in pypdf 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.
52 security1 new APIs and options4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpypdf 657 changes
Security 52
Only /DCTDecode image data is opened with the Pillow JPEG plugin.
Improves performance and limits field work.
Limits stream parsing work.
Prevents cyclic tree handling.
pypdf: Possible large memory usage when retrieving alphabetical page labels
pypdf: Possible long runtimes when generating appearance streams
pypdf: Possible long runtimes with large amount of embedded files
pypdf: Possible large memory usage for large /ToUnicode streams (Follow-up 2)
pypdf: Possible large memory usage when parsing font data
pypdf: Possible long runtimes for partially malformed FlateDecode streams (Follow-up)
pypdf: Possible long runtimes/large memory usage when parsing indirect objects
pypdf: Possible large memory usage when retrieving Roman page labels
pypdf: Possible long runtimes/large memory usage when extracting XForm objects
pypdf: Possible long runtimes/large memory usage when retrieving outlines
pypdf: Possible infinite loop for TreeObject.insert_child
pypdf: Inefficient handling of non-whitespace inputs in read_until_whitespace
pypdf: Possible large memory usage for large /ToUnicode streams
pypdf: Possible long runtimes/large memory usage for large CID font width ranges
pypdf: Possible infinite loop for not terminated inline images (ASCII85 and ASCIIHex filter)
pypdf: Possible infinite loop for not terminated inline images
pypdf: Possible large memory usage for wrong image dimensions
pypdf: Possible long runtimes for repeated malformed cross-reference entries
pypdf: Missing stream length values ignore defined limits
pypdf: Possible infinite loop when processing threads/articles in writer
pypdf: Possible infinite loop when processing outlines/bookmarks in writer
pypdf: Possible infinite loop when retrieving fonts for layout-mode text extraction
pypdf: Inefficient decoding of FlateDecode PNG predictor streams
pypdf: Possible large memory usage for form XObjects during text extraction
pypdf: Manipulated XMP metadata streams can exhaust RAM
pypdf: Possible large memory usage for large offsets for layout mode text
pypdf: Possible long runtimes for zero-only width values in cross-reference streamsuntimes for zero-only width values in cross-reference streams
pypdf: Manipulated FlateDecode image dimensions can exhaust RAM
pypdf: Manipulated FlateDecode predictor parameters can exhaust RAM
pypdf: Possible long runtimes for wrong size values in incremental mode
pypdf has long runtimes for wrong size values in cross-reference and object streams
pypdf: Manipulated XMP metadata entity declarations can exhaust RAM
pypdf: Possible infinite loop during recovery attempts in DictionaryObject.read_from_stream
pypdf has inefficient decoding of array-based streams
pypdf: manipulated stream length values can exhaust RAM
pypdf vulnerable to inefficient decoding of ASCIIHexDecode streams
pypdf: Manipulated RunLengthDecode streams can exhaust RAM
pypdf: Manipulated FlateDecode XFA streams can exhaust RAM
pypdf has a possible infinite loop when loading circular /Prev entries in cross-reference streams
pypdf has a possible infinite loop when processing TreeObject
pypdf has possible long runtimes/large memory usage for large /ToUnicode streams
pypdf possibly has long runtimes for malformed FlateDecode streams
pypdf has possible Infinite Loop when processing outlines/bookmarks
pypdf has possible long runtimes for malformed startxref
pypdf has possible long runtimes for missing /Root object with large /Size values
pypdf's LZWDecode streams be manipulated to exhaust RAM
pypdf can exhaust RAM via manipulated LZWDecode streams
pypdf possibly loops infinitely when reading DCT inline images without EOF marker
New APIs and options 1
Allows custom fit modes for named destinations.
Fixes and other changes 4
Avoids overwriting unread objects in add_form_topname.
Treats NUL as whitespace in ArrayObject.
Reads an indirect page box on a writer page.
Only reads the color operator from a text field's default appearance.