Skip to content
Discussion options

You must be logged in to vote

which worked regularly until 6.9.0.

The relevant change happened in version 6.8.0 to mitigate a memory issue with invalid length values. Version 6.9.1 should not have corresponding changes as far as I am aware.

It is probably not a good idea to use static stream lengths here, but at least to have this value (MAX_DECLARED_STREAM_LENGTH) configurable.

This already is configurable, see the docs: https://pypdf.readthedocs.io/en/latest/user/security.html#filters (There are some undocumented limit values which are configurable less easily, but you are not hitting them here.)

At the moment, this requires monkey-patching:

import pypdf.filters

pypdf.filters.MAX_DECLARED_STREAM_LENGTH = 100_00…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rkrell
Comment options

@stefan6419846
Comment options

Answer selected by rkrell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3695 on March 25, 2026 13:39.