Skip to content

Arbitrary expression injection in Pillow

Critical severity GitHub Reviewed Published Jan 12, 2022 to the GitHub Advisory Database • Updated Apr 22, 2024

Package

pip Pillow (pip)

Affected versions

< 9.0.1

Patched versions

9.0.1

Description

PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method ImageMath.eval("exec(exit())").

While Pillow 9.0.0 restricted top-level builtins available to PIL.ImageMath.eval(), it did not prevent builtins available to lambda expressions. These are now also restricted in 9.0.1.

References

Published by the National Vulnerability Database Jan 10, 2022
Reviewed Jan 11, 2022
Published to the GitHub Advisory Database Jan 12, 2022
Last updated Apr 22, 2024

Severity

Critical
9.8
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Weaknesses

CVE ID

CVE-2022-22817

GHSA ID

GHSA-8vj2-vxx3-667w

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.