Skip to content

Upgrade Pillow to 13.x (security) - #4

Merged
mrgluek merged 1 commit into
mainfrom
upgrade-pillow-13
Nov 27, 2026
Merged

mrgluek merged 1 commit into
mainfrom
upgrade-pillow-13

Conversation

@mrgluek

@mrgluek mrgluek commented Nov 27, 2026

Copy link
Copy Markdown
Owner

What

requirements.txt: pillow>=10.4.0,<11.0.0 -> pillow>=13.0.0,<14.0.0. Pillow 10.4.0 is flagged by pip-audit with dozens of CVEs fixed in 12.x/13.0.0. No other pins exist (Dockerfile and CI install from requirements.txt).

Code impact

Pillow is only reached through qrcode (bot.py: SVG via SvgPathImage, PNG via PilImage save(format="PNG"), ASCII via print_ascii). The bot makes no direct PIL import. I read the Pillow 11, 12 and 13 release notes: removed APIs (PSFile, ImageMath.eval, Image._show, I-mode PNG save, etc.) are not used. Pillow 13 drops Python 3.10; Dockerfile uses 3.11 and CI 3.12, so both are supported. No code change needed.

Evidence (venvs outside the repo; py3.12.13 and py3.11.15)

  • pip-audit -r requirements.txt: before, 69 lines mentioning Pillow; after, No known vulnerabilities found.
  • Installed: pillow 13.0.0 (newest on PyPI), qrcode 7.4.2.
  • Image script (qrcode SVG, PNG at box_size=6, ASCII, plus resize/convert and PNG/JPEG/WEBP/GIF round trips, run with -W error): sha256 of the SVG, decoded PNG pixels and ASCII output are identical for Pillow 10.4.0 (py3.12), 13.0.0 (py3.12) and 13.0.0 (py3.11). No warnings.
  • Full suite (python -m unittest discover -s tests -p "test_*.py", 1044 tests), run sequentially:
    • Pillow 10.4.0 py3.12: 1 failure; Pillow 13.0.0 py3.12: same 1 failure; Pillow 13.0.0 py3.11: same 1 failure.
    • The failure is test_rpc_methods picking up a different deltachat-rpc-server from my shell PATH, not the venv one. With the venv on PATH (PATH=<venv>/bin:$PATH) it passes, so the suite is green apart from this environment quirk.

Not verified

  • Docker image build and the real deployed qr.png/qr.svg endpoints (no deploy, no server access).
  • Python 3.13+ not tested. Production QR rendering is covered by the script above only.

pillow<11 pinned 10.4.0, which pip-audit flags with dozens of CVEs fixed in 12.x/13.0.0.
Raise the range to >=13.0.0,<14.0.0. Pillow 13 needs Python 3.11+ (Dockerfile uses 3.11, CI 3.12).
The only PIL use is qrcode's PNG/SVG/ASCII rendering; output is byte-identical before and after.
@mrgluek
mrgluek merged commit 5e8741d into main Nov 27, 2026
1 check passed
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.

1 participant