Skip to content

Fix pypdf vulnerabilities by updating to safe version#1374

Merged
CrystalPea merged 1 commit into
mainfrom
rp-update-pypdf
Jun 18, 2026
Merged

Fix pypdf vulnerabilities by updating to safe version#1374
CrystalPea merged 1 commit into
mainfrom
rp-update-pypdf

Conversation

@rparke

@rparke rparke commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

We upgrade pypdf to 6.12.0 which fixes several vulnerabilities:

  1. https://github.com/alphagov/notifications-utils/security/dependabot/40 - when we use the pdf reader we are vulnerable to an expansion attack with Manipulated XMP metadata entity declarations that exhausts memory and causes a denial of service.

  2. https://github.com/alphagov/notifications-utils/security/dependabot/45 - when we use the PdfReader we are vulnerable to RAM exhaustion attack by manipulated FlateDecode image dimensions. This can cause resource overuse and denial of service.

  3. https://github.com/alphagov/notifications-utils/security/dependabot/44 - when we use the PdfReader we are vulnerable to RAM exhaustion attack by manipulated FlateDecode predictor parameters. This can cause resource overuse and denial of service.

  4. https://github.com/alphagov/notifications-utils/security/dependabot/55 - when we use the PdfReader we are vulnerable to artificially extended runtimes, leading to slower service / denial of service / larger use of resouces.

  5. https://github.com/alphagov/notifications-utils/security/dependabot/42 - when we use the PdfReader we are vulnerable to artificially extended runtimes, leading to slower service / denial of service / larger use of resouces.

The risk of us being exploited by these vulnerabilities is fairly low (as only our service users provide PDFs vs general public) but it is not zero and could DoS any app components that are using pypdf to read pdfs

all tests in utils pass with the upgrade

All vulnerabilities also added to the spreadsheet: https://docs.google.com/spreadsheets/d/1g1Lji_1-jPx6MUT9kRZMM8riZhzkY-s0IlP-RKSoVlA/edit?usp=sharing

@rparke rparke force-pushed the rp-update-pypdf branch from 9d11316 to 218b2b1 Compare June 17, 2026 14:07
@CrystalPea CrystalPea force-pushed the rp-update-pypdf branch 3 times, most recently from 08e267b to bc621a0 Compare June 17, 2026 15:36
@CrystalPea CrystalPea changed the title fix vulnerability with pypdf Fix pypdf vulnerabilities by updating to safe version Jun 17, 2026
@CrystalPea CrystalPea marked this pull request as ready for review June 17, 2026 15:48
We upgrade pypdf to 6.12.0 which fixes several vulnerabilities:

1) https://github.com/alphagov/notifications-utils/security/dependabot/40
- when we use the pdf reader we are vulnerable to an expansion attack with
manipulated XMP metadata entity declarations that exhausts memory and causes a denial of service.

2) https://github.com/alphagov/notifications-utils/security/dependabot/45
- when we use the PdfReader we are vulnerable to RAM exhaustion attack by
manipulated FlateDecode image dimensions. This can cause resource overuse and denial of service.

3) https://github.com/alphagov/notifications-utils/security/dependabot/44
- when we use the PdfReader we are vulnerable to RAM exhaustion attack by
manipulated FlateDecode predictor parameters. This can cause resource overuse and denial of service.

4) https://github.com/alphagov/notifications-utils/security/dependabot/55
- when we use the PdfReader we are vulnerable to artificially extended runtimes,
leading to slower service / denial of service / larger use of resouces.

5) https://github.com/alphagov/notifications-utils/security/dependabot/42
- when we use the PdfReader we are vulnerable to artificially extended runtimes,
leading to slower service / denial of service / larger use of resouces.

The risk of us being exploited by these vulnerabilities is fairly low
(as only our service users provide PDFs vs general public) but it is not zero and
could DoS any app components that are using pypdf to read pdfs

all tests in utils pass with the upgrade.

The upgrade is for requirements_for_test only, because to update the minimum version in pyproject.toml,
and for that to be safely consumed by the repos that use utils, including template-preview,
we need extensive testing. Dove team will be working on that.

Co-authored-by: Mervi Tyczynska <mervi.tyczynska@digital.cabinet-office.gov.uk>
@CrystalPea CrystalPea merged commit 62af3cd into main Jun 18, 2026
6 checks passed
@CrystalPea CrystalPea deleted the rp-update-pypdf branch June 18, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants