fix: pin cryptography for the Flatpak and bump pypdf past six CVEs - #175
Merged
Conversation
The Flatpak manifest never listed cryptography, which breaks AES encryption and AES-encrypted PDF opening in the Flatpak build. pypdf declares cryptography only as the optional `crypto` extra, and the manifest installs with `--no-index --find-links`, so the extra is never resolved from PyPI and the wheel is simply absent from the sandbox. The failure is asymmetric, which is why it went unnoticed: the editor opens encrypted PDFs through PyMuPDF, which carries its own crypto and kept working, while the Encrypt tool goes through pypdf and raised DependencyError. Only the pypdf path was dead. Dependency floors: - pypdf 6.14.2 was exposed to six advisories: PYSEC-2026-3655 and PYSEC-2026-3656 (fixed in 6.15.0), CVE-2026-82398 (6.15.0), CVE-2026-84309 (6.16.0), and CVE-2026-84310 / CVE-2026-84311 (6.16.1). 6.15.0 still carried three of them, so the floor is 6.16.2 rather than the 6.15.0 the earliest advisory alone would suggest. - cryptography is floored at 50.0.1 for PYSEC-2026-3552 / CVE-2026-69247, a Bleichenbacher oracle in PKCS#7 EnvelopedData decryption introduced in 44.0.0 and fixed in 50.0.0. 49.0.0 is the only release in the 49 series and it is vulnerable, so the previous `cryptography>=49.0.0` floor could never resolve to a safe version. Adds tests/test_flatpak_dependency_pins.py with eight consistency tests tying requirements.txt, flatpak/requirements-pinned.txt and flatpak/python-modules.yml together, since flatpak/python-modules.yml has no reference anywhere in .github/ and so nothing in CI reads it. Also corrects flatpak/README.md, which claimed Dependabot keeps the shared packages in sync. It does not: .github/dependabot.yml declares the pip ecosystem only for `directory: "/"`, so nothing under flatpak/ is ever bumped or added. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Python dependencies security checkpip-audit:
|
| Package | Pin | Latest on PyPI | Status |
|---|---|---|---|
| PySide6 | PySide6>=6.11.1 |
6.11.2 |
outdated |
| pypdf | pypdf>=6.16.2 |
6.16.2 |
up-to-date |
| cryptography | cryptography>=50.0.1 |
50.0.1 |
up-to-date |
| qtawesome | qtawesome>=1.4.2 |
1.4.2 |
up-to-date |
| pillow | pillow>=12.3.0 |
12.3.0 |
up-to-date |
| pymupdf | pymupdf>=1.28.0 |
1.28.2 |
outdated |
| pytesseract | pytesseract>=0.3.13 |
0.3.13 |
up-to-date |
| python-docx | python-docx>=1.2.0 |
1.2.0 |
up-to-date |
| python-pptx | python-pptx>=1.0.2 |
1.0.2 |
up-to-date |
| openpyxl | openpyxl>=3.1.5 |
3.1.5 |
up-to-date |
| beautifulsoup4 | beautifulsoup4>=4.15.0 |
4.15.0 |
up-to-date |
| ebooklib | ebooklib>=0.20 |
0.20 |
up-to-date |
| lxml | lxml>=6.1.1 |
6.1.3 |
outdated |
| urllib3 | urllib3>=2.7.0 |
2.7.0 |
up-to-date |
| idna | idna>=3.18 |
error (URLError) |
|
| pyinstaller | pyinstaller>=6.21.0 |
6.22.2 |
outdated |
Auto-generated by security-deps workflow. Merge is blocked only when pip-audit --strict reports vulnerabilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Flatpak manifest never listed
cryptography, which leaves AES encryption and AES-encrypted PDF opening broken in the Flatpak build.pypdfdeclarescryptographyonly as the optionalcryptoextra, andflatpak/python-modules.ymlinstalls with--no-index --find-links, so the extra is never resolved from PyPI and the wheel is simply absent from the sandbox.The failure is asymmetric, which is why it went unnoticed for so long:
DependencyError.Only the pypdf path was dead, so the feature looked half-alive rather than broken.
Dependency floors
pypdf: 6.14.2 to 6.16.2. 6.14.2 was exposed to six advisories:
6.15.0 still carried three of them, so the floor is 6.16.2 rather than the 6.15.0 the earliest advisory alone would suggest.
cryptography: 49.0.0 to 50.0.1. PYSEC-2026-3552 / CVE-2026-69247 is a Bleichenbacher oracle in PKCS#7
EnvelopedDatadecryption, introduced in 44.0.0 and fixed in 50.0.0. 49.0.0 is the only release in the 49 series and it is vulnerable, so the previouscryptography>=49.0.0floor could never resolve to a safe version at all.Tests
Adds
tests/test_flatpak_dependency_pins.pywith eight consistency tests tyingrequirements.txt,flatpak/requirements-pinned.txtandflatpak/python-modules.ymltogether. This matters becauseflatpak/python-modules.ymlhas no reference anywhere in.github/, so nothing in CI reads it and drift is otherwise invisible.Also corrects
flatpak/README.md, which claimed Dependabot keeps the shared packages in sync. It does not:.github/dependabot.ymldeclares thepipecosystem only fordirectory: "/", so nothing underflatpak/is ever bumped or added.Verification
What this PR does NOT fix
Recorded deliberately so none of it is mistaken for solved:
security-deps.ymlgate is weak by construction.pip-auditover open floors resolves to the newest version and never sees the minimum the floor actually permits. That blindness is exactly what letcryptography>=49.0.0pass green with an open CVE. Needs its own PR.PySide6_Essentials,PySide6_Addons,cffi,pycparser,qtpy,packaging,lxml,typing_extensions. A pip resolution run aborts at PySide6. This PR increases the deficit by 2 (cffiandpycparser, pulled in bycryptography), but the build was already failing beforehand, so nothing regresses in practice. Needs its own issue.python-modules.yml: corrupted SHA256, non-existent URL, wrong platform tag. Neither CI nor the tests verify wheel integrity.Note on CI
This PR will trigger
security-deps.yml, because it touchesrequirements.txtandflatpak/requirements-pinned.txt, both in the workflow'spathstrigger. That is intended: it is precisely what the workflow exists to check, and it should now pass, sincepip-auditover the pinned file came back clean.🤖 Generated with Claude Code