Skip to content

Bump pillow from 6.2.0 to 12.2.0 in /images#3690

Open
dependabot[bot] wants to merge 1 commit intomasterfrom
dependabot/pip/images/pillow-12.2.0
Open

Bump pillow from 6.2.0 to 12.2.0 in /images#3690
dependabot[bot] wants to merge 1 commit intomasterfrom
dependabot/pip/images/pillow-12.2.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github May 5, 2026

Bumps pillow from 6.2.0 to 12.2.0.

Release notes

Sourced from pillow's releases.

12.2.0

https://pillow.readthedocs.io/en/stable/releasenotes/12.2.0.html

Documentation

Dependencies

Testing

Other changes

... (truncated)

Changelog

Sourced from pillow's changelog.

Changelog (Pillow)

11.1.0 and newer

See GitHub Releases:

11.0.0 (2024-10-15)

  • Update licence to MIT-CMU #8460 [hugovk]

  • Conditionally define ImageCms type hint to avoid requiring core #8197 [radarhere]

  • Support writing LONG8 offsets in AppendingTiffWriter #8417 [radarhere]

  • Use ImageFile.MAXBLOCK when saving TIFF images #8461 [radarhere]

  • Do not close provided file handles with libtiff when saving #8458 [radarhere]

  • Support ImageFilter.BuiltinFilter for I;16* images #8438 [radarhere]

  • Use ImagingCore.ptr instead of ImagingCore.id #8341 [homm, radarhere, hugovk]

  • Updated EPS mode when opening images without transparency #8281 [Yay295, radarhere]

  • Use transparency when combining P frames from APNGs #8443 [radarhere]

  • Support all resampling filters when resizing I;16* images #8422 [radarhere]

  • Free memory on early return #8413 [radarhere]

  • Cast int before potentially exceeding INT_MAX #8402 [radarhere]

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps [pillow](https://github.com/python-pillow/Pillow) from 6.2.0 to 12.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](python-pillow/Pillow@6.2.0...12.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-version: 12.2.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update python code labels May 5, 2026
@claude
Copy link
Copy Markdown

claude Bot commented May 5, 2026

Dependency Review: Pillow 6.2.0 → 12.2.0

🔍 Dependency Analysis Summary

Package Old Version New Version Type
Pillow 6.2.0 12.2.0 Python imaging library (build tooling only)

Context: This change is limited to images/requirements.txt, which contains Python tooling for generating Android drawable assets. It does not affect the Android app itself.

Overall Risk: HIGH — The version jump spans 6 major releases (7.x through 12.x) with 24+ CVEs fixed, but the existing code in images/dpi_manager.py uses removed APIs and Python 2 syntax that will cause immediate runtime failures with Pillow 12.2.0.


📋 Detailed Changelog Review

Package: Pillow (6.2.0 → 12.2.0)

Security Fixes (24+ CVEs) — this is why the update is critical:

  • CVE-2022-22817 / CVE-2023-50447: Remote code execution via ImageMath.eval()eval() is completely removed in Pillow 12.0
  • CVE-2023-4863: Heap buffer overflow in libwebp
  • CVE-2024-28219: Buffer overflow in _imagingcms.c
  • CVE-2020-10177/10378/10379/10994/11538: OOB reads/writes in FLI, PCX, TIFF, JPEG2000, SGI decoders
  • CVE-2021-27921/27922/27923: Memory DOS via BLP, ICNS, ICO images
  • CVE-2026-25990: OOB write in PSD decoding (most recent, v12.1.1)
  • Multiple additional memory DOS and buffer overflow CVEs in 8.x–10.x

Breaking Changes (relevant to this codebase):

Version Breaking Change Impact on CommCare images/
9.1.0 Image.ANTIALIAS deprecated ⚠️ Warning on use
10.0.0 Image.ANTIALIAS removed 💥 Runtime error (AttributeError)
10.0.0 Old integer resampling constants removed 💥 Same issue
12.0.0 Requires Python 3.10+ 💥 Incompatible with Python 2

⚠️ Impact Assessment

Breaking Changes Found: YES — the scripts will fail immediately if run.

images/dpi_manager.py issues:

  1. Line 125 & 136 — Image.ANTIALIAS removed (Pillow 10.0.0)

    # Current code — BREAKS with Pillow 10.0+
    src_img.resize((dpi_width, dpi_height), Image.ANTIALIAS)
    
    # Required fix
    src_img.resize((dpi_width, dpi_height), Image.Resampling.LANCZOS)
  2. Lines 108, 116, 128, 139 — Python 2 print statements

    # Current code — syntax error in Python 3
    print "save to", dpi_path
    
    # Required fix
    print("save to", dpi_path)

    This script appears to be Python 2-era code. Pillow 12.x requires Python 3.10+, making the entire file incompatible as-is.

  3. Line 95 — numpy.fromstring() deprecated

    # Current code — deprecated, use frombuffer instead
    premult = numpy.fromstring(src_img.tobytes(), dtype=numpy.uint8)
    
    # Required fix
    premult = numpy.frombuffer(src_img.tobytes(), dtype=numpy.uint8)

Additional concerns in requirements.txt (not changed by this PR):

  • numpy==1.9.1 (2014!) — almost certainly incompatible with Python 3.10+
  • PyYAML==5.1 — has CVE-2020-14343 (arbitrary code execution via yaml.load())
  • CairoSVG==2.5.1 — may have Python 3.10 compatibility issues

Affected Files:

  • images/dpi_manager.py — requires fixes before Pillow 12.x will work
  • images/requirements.txt — other dependencies need updating alongside Pillow

🛠️ Recommendations

Action Required: This PR should not be merged as-is. The security update is absolutely necessary (24+ CVEs including RCE), but the scripts must be updated before bumping to Pillow 12.2.0, or the build tooling will silently break.

Suggested approach — update dpi_manager.py alongside this PR:

# Line 95: replace deprecated numpy.fromstring
premult = numpy.frombuffer(src_img.tobytes(), dtype=numpy.uint8).copy()

# Lines 125, 136: replace removed Image.ANTIALIAS
src_img.resize((dpi_width, dpi_height), Image.Resampling.LANCZOS).save(dpi_path)

# Lines 108, 116, 128, 139: Python 3 print() calls
print("save to", dpi_path)

Also consider bumping the other stale dependencies in requirements.txt in the same PR:

  • PyYAML==5.1PyYAML>=6.0 (fixes CVE-2020-14343)
  • numpy==1.9.1numpy>=1.26 (compatible with Python 3.10+)

Testing Focus:

  • Verify Python 3.10+ is available in the environment where these image generation scripts are run
  • Run make_drawables.py against a test image to confirm the resize/save pipeline works end-to-end with the updated dependencies
  • Confirm generated drawable assets are pixel-correct (LANCZOS == ANTIALIAS, just renamed)

Follow-up Tasks:

  • Audit whether the images/ tooling is still actively used in CI or developer workflows; if it's dead code, consider removing it entirely
  • Open a separate issue for PyYAML CVE-2020-14343 if not already tracked

Merge Recommendation: REVIEW_NEEDED

The security intent is correct and urgent — staying on Pillow 6.2.0 exposes the environment to 24+ known CVEs. However, merging this PR as-is will break the image generation scripts. Please fix dpi_manager.py (and ideally the other stale deps) before merging.


📚 Useful Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants