Skip to content

Update dependency pillow to v12.2.0 [SECURITY]#249

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/pypi-pillow-vulnerability
Open

Update dependency pillow to v12.2.0 [SECURITY]#249
renovate[bot] wants to merge 1 commit intomainfrom
renovate/pypi-pillow-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Apr 13, 2026

This PR contains the following updates:

Package Change Age Confidence
pillow (changelog) ==12.1.1==12.2.0 age confidence

GitHub Vulnerability Alerts

CVE-2026-40192

Impact

Pillow did not limit the amount of GZIP-compressed data read when decoding a FITS image, making it vulnerable to decompression bomb attacks. A specially crafted FITS file could cause unbounded memory consumption, leading to denial of service (OOM crash or severe performance degradation).

Patches

The amount of data read is now limited to the necessary amount.
Fixed in Pillow 12.2.0 (PR #​9521).

Workarounds

Avoid Pillow >= 10.3.0, < 12.2.0
Only open specific image formats, excluding FITS.

Severity
  • CVSS Score: 8.7 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Release Notes

python-pillow/Pillow (pillow)

v12.2.0

Compare Source

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

Documentation

Dependencies

Testing

Other changes


Configuration

📅 Schedule: (in timezone UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

pandas==2.2.3
matplotlib==3.10.8
pillow==12.1.1
pillow==12.2.0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 This PR fixes CVE-2026-40192 in template/requirements.txt by upgrading Pillow to 12.2.0, but chart_data_extractor/poetry.lock still pins Pillow at 12.1.1 (line 599), leaving that environment exposed to the same FITS decompression bomb vulnerability. Run poetry update pillow in chart_data_extractor/ and commit the updated lock file to complete the fix.

Extended reasoning...

Incomplete security fix: chart_data_extractor/poetry.lock still pins Pillow 12.1.1

This PR correctly updates template/requirements.txt to pillow==12.2.0 to patch CVE-2026-40192, which allows a specially crafted FITS image to trigger unbounded GZIP decompression, leading to OOM denial-of-service. However, the repository contains a second Pillow installation path that was not updated: chart_data_extractor/poetry.lock.

Affected code path: In chart_data_extractor/poetry.lock (lines 598–603), the lock file resolves Pillow to version 12.1.1 with optional = false and groups = ["main"]. This means Pillow is a non-optional, main-group dependency that is unconditionally installed by poetry install. Pillow arrives as a transitive dependency of matplotlib (which pyproject.toml lists as a direct dependency), and the lock file explicitly pins it to the vulnerable version.

Why existing checks don't catch it: The PR diff only touches template/requirements.txt. Poetry lock files are not automatically updated when a requirements.txt in a sibling directory is changed; each directory with a pyproject.toml/poetry.lock pair is managed independently. The CI workflow .github/workflows/charts_tests.yml runs poetry install in chart_data_extractor/, so every CI build for that component installs the vulnerable Pillow 12.1.1.

Impact: Any developer or CI pipeline that runs poetry install in chart_data_extractor/ will install Pillow 12.1.1 and remain exposed to CVE-2026-40192. While chart_data_extractor itself may not directly process FITS images, Pillow is present in the environment and could be exercised by upstream code, tests, or future changes.

Step-by-step proof:

  1. A developer clones the repo and runs poetry install in chart_data_extractor/.
  2. Poetry reads chart_data_extractor/poetry.lock and installs pillow==12.1.1 (line 599) because optional = false and it is in the main group.
  3. The installed Pillow is the vulnerable 12.1.1, not the patched 12.2.0.
  4. An attacker can supply a crafted FITS file to any code path that invokes PIL.Image.open(), triggering unbounded memory consumption.

Fix: Run poetry update pillow (or poetry lock --no-update after manually editing pyproject.toml to constrain the version) inside chart_data_extractor/, then commit the updated poetry.lock as part of this PR.

Copy link
Copy Markdown

@codeCraft-Ritik codeCraft-Ritik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great update! Upgrading Pillow to address CVE-2026-40192 is an important security fix.
Nice to see proactive handling of potential DoS vulnerabilities 👍

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