Critical
Security advisory
PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method. A lambda expression could also be used.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2022-22817
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 16:00 UTC · Revision 1
Source evidence
PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method. A lambda expression could also be used.
osv:CVE-2022-22817
Complete source record
{
"id": "7b84776e318929974a3e930c83a50128e396ab0a17508235bac166829a31710b",
"url": "https://osv.dev/vulnerability/CVE-2022-22817",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2022-22817",
"summary": "PIL.ImageMath.eval in Pillow before 9.0.0 allows evaluation of arbitrary expressions, such as ones that use the Python exec method. A lambda expression could also be used.",
"evidence": "osv:CVE-2022-22817",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2022-22817",
"aliases": [
"BIT-pillow-2022-22817",
"CVE-2022-22817",
"GHSA-8vj2-vxx3-667w",
"PYSEC-2022-10"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/python-pillow/pillow",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "6deac9e3a23caffbfdd75c00d3f0a1cd36cdbd5d"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "9.0.1"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"9.0.0",
"8.4.0",
"8.3.0",
"8.2.0",
"8.1.0",
"8.0.0",
"7.2.0",
"7.1.0",
"7.0.0",
"6.2.0",
"6.1.0",
"6.0.0",
"5.4.0",
"5.3.0",
"5.2.0",
"5.1.0",
"5.0.0",
"4.3.0",
"4.2.0",
"4.1.0",
"4.0.0",
"4.0.0a",
"3.4.0",
"3.3.0",
"3.2.0",
"3.1.0",
"3.1.0-rc1",
"2.9.0",
"2.9.0.dev2",
"2.9.0.dev1",
"2.9.0.dev0",
"2.8.1",
"2.8.0",
"2.7.0",
"2.5.0",
"2.3.0",
"2.2.1",
"2.2.0",
"2.1.0",
"2.0.0",
"1.7.8",
"1.7.7",
"1.2",
"1.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-22817.json"
}
}
],
"modified": "2026-10-28T02:30:37.015270461Z",
"provider": "osv",
"references": [
"https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval",
"https://pillow.readthedocs.io/en/stable/releasenotes/9.0.1.html#security",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/22xxx/CVE-2022-22817.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-22817",
"https://security.gentoo.org/glsa/202211-10",
"https://www.debian.org/security/2022/dsa-5053",
"https://lists.debian.org/debian-lts-announce/2022/01/msg00018.html",
"https://lists.debian.org/debian-lts-announce/2024/03/msg00021.html"
],
"provider_metadata": {
"cna_assigner": "mitre",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/22xxx/CVE-2022-22817.json"
}
},
"related_cves": [
{
"value": "CVE-2022-22817",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 504419,
"published_at": "2022-01-07T00:00:00+00:00"
}