{
  "id": "CVE-2026-59197",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-59197",
  "published_at": "2026-07-14T16:25:23.52Z",
  "title": "Pillow: Heap out-of-bounds write in Pillow `ImageFilter.RankFilter` via integer overflow in `ImagingExpand`",
  "vendor": "python-pillow",
  "product": "Pillow",
  "cvss": {
    "score": 8.2,
    "source": "cna",
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "Pillow is a Python imaging library. Prior to 12.3.0, Pillow's public rank-filter API can trigger a native heap out-of-bounds write when given a very large odd filter size because ImageFilter.RankFilter.filter() calls image.expand(size // 2, size // 2) before rank-filter size validation and ImagingExpand() computes output dimensions with unchecked signed int arithmetic. This issue is fixed in version 12.3.0.",
  "cwe": "CWE-787",
  "cpes": [
    "cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 8.2
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "python-pillow",
        "product": "Pillow",
        "ranges": [
          "\u003c 12.3.0"
        ],
        "fixed_in": [
          "12.3.0"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Pillow to 12.3.0 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/python-pillow/Pillow/security/advisories/GHSA-xj96-63gp-2gmr"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/python-pillow/Pillow/pull/9695"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/python-pillow/Pillow/commit/cce3bdb867c77a3420261ed1bfdb6b0787ec8fc1"
      },
      {
        "kind": "Release notes",
        "url": "https://github.com/python-pillow/Pillow/releases/tag/12.3.0"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
