Skip to content

fix: update pillow minimum version to address CVE vulnerabilities#1886

Open
octo-patch wants to merge 1 commit into
sinaptik-ai:mainfrom
octo-patch:fix/issue-1871-update-pillow-cve
Open

fix: update pillow minimum version to address CVE vulnerabilities#1886
octo-patch wants to merge 1 commit into
sinaptik-ai:mainfrom
octo-patch:fix/issue-1871-update-pillow-cve

Conversation

@octo-patch

Copy link
Copy Markdown

Fixes #1871

Problem

The current Pillow dependency constraint ^10.1.0 allows installation of Pillow versions with known security vulnerabilities:

  • CVE-2023-50447 (Critical) - Arbitrary code execution via PIL.ImageMath.eval() environment parameter. Fixed in Pillow 10.2.0.
  • CVE-2024-28219 (High) - Buffer overflow in _imagingcms.c due to unchecked strcpy calls when processing ICC profiles. Fixed in Pillow 10.3.0.

Solution

Updated the minimum Pillow version from ^10.1.0 to >=10.3.0. This:

  • Enforces a minimum safe version (10.3.0) that addresses both CVEs
  • Removes the artificial <11.0.0 upper cap, allowing users on newer Python versions to install Pillow 11.x or 12.x
  • Maintains backward compatibility with Python 3.8+ (Pillow 10.x supports Python 3.8)

Testing

The change only affects the dependency constraint in pyproject.toml. The PIL API usage in pandasai/core/response/chart.py (Image.open, Image.save, Image.show) is stable across all Pillow 10.x+ versions.

 sinaptik-ai#1871)

The previous constraint `^10.1.0` allowed Pillow versions as old as 10.1.0,
which contain known security vulnerabilities:
- CVE-2023-50447 (arbitrary code execution via PIL.ImageMath.eval, fixed in 10.2.0)
- CVE-2024-28219 (buffer overflow in _imagingcms.c, fixed in 10.3.0)

Updated to `>=10.3.0` to enforce a minimum safe version while also allowing
users to install newer Pillow versions (11.x, 12.x) compatible with their
Python environment.
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.

pillow of version ^10.1.0 has OOB CVE

1 participant