Pillow is a Python imaging library. Prior to 13.0.0, Pillow's ImageMorph.MorphOp.apply() can access memory before a row buffer for a zero-width image. PPM and PGM input can create an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry. An attacker can supply such an image to an application that applies a morphology operation. This can crash the process. This issue is fixed in version 13.0.0.
{
"cna_assigner": "GitHub_M",
"cwe_ids": [
"CWE-787"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/112xxx/CVE-2026-112397.json",
"unresolved_ranges": [
{
"extracted_events": [
{
"range": [
{
"fixed": "13.0.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
}
]
},
{
"extracted_events": [
{
"range": [
{
"fixed": "13.0.0"
},
{
"fixed": "13.0.0"
}
],
"source": "DESCRIPTION"
}
]
}
]
}{
"extracted_events": [
{
"range": [
{
"fixed": "18f7c0dfee93063c51db6ed0ca8c4da2999dcb64"
}
],
"source": "REFERENCES_COMMIT"
},
{
"original_tag": "13.0.0",
"range": [
{
"fixed": "293218ad059d994baf1777d882911bed6a49704a"
}
],
"source": "REFERENCES_TAG"
}
]
}
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-112397.json"
[
{
"deprecated": false,
"digest": {
"function_hash": "243319032586515496261604633944897078201",
"length": 2047
},
"id": "CVE-2026-112397-76acd24f",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/python-pillow/pillow/commit/18f7c0dfee93063c51db6ed0ca8c4da2999dcb64",
"target": {
"file": "src/_imagingmorph.c",
"function": "apply"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"5246180853856306288135613715708377611",
"59317288987623968973807059348763683501",
"182421049134112409957475223500800122750",
"82119221215197934449899932877664298324"
],
"threshold": 0.9
},
"id": "CVE-2026-112397-c29d8b95",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/python-pillow/pillow/commit/18f7c0dfee93063c51db6ed0ca8c4da2999dcb64",
"target": {
"file": "src/_imagingmorph.c"
}
}
]
"2026-10-21T09:39:59Z"