Skip to content
Heist/ feed
Back to feed
HighFix available

Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer

Type: advisorySources: OSV

Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.

Products
pillow
Affected versions
Not specified
Fixed versions
13.0.0
CVEs
CVE-2026-112396
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 17:55 UTC · Revision 1

Source evidence

Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer

core-osv · Original source

Published 26 Oct 2026, 05:55 UTC

Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.

osv:BIT-pillow-2026-112396

pillow

Fixed versions: 13.0.0

Complete source record
{
  "id": "99b38b3d7732e14b71de43b1f6f62fb6b3bdb24bde090444c89826cc5f619b85",
  "url": "https://osv.dev/vulnerability/BIT-pillow-2026-112396",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer",
    "summary": "Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.",
    "evidence": "osv:BIT-pillow-2026-112396",
    "products": [
      {
        "name": {
          "value": "pillow",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "13.0.0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "BIT-pillow-2026-112396",
      "aliases": [
        "BIT-pillow-2026-112396",
        "CVE-2026-112396",
        "GHSA-4rr5-89j8-mwwm",
        "PYSEC-2026-4328"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "11.3.0"
                },
                {
                  "fixed": "13.0.0"
                }
              ]
            }
          ],
          "package": {
            "name": "pillow",
            "purl": "pkg:bitnami/pillow",
            "ecosystem": "Bitnami"
          },
          "severity": [
            {
              "type": "CVSS_V3",
              "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
            }
          ],
          "database_specific": {
            "source": "https://github.com/bitnami/vulndb/tree/main/data/pillow/BIT-pillow-2026-112396.json"
          }
        }
      ],
      "modified": "2026-10-27T11:10:49.694224501Z",
      "provider": "osv",
      "references": [
        "https://github.com/python-pillow/Pillow/commit/dc95da20207827a062cfbf551ee9f6031465a8bb",
        "https://github.com/python-pillow/Pillow/releases/tag/13.0.0",
        "https://github.com/python-pillow/Pillow/security/advisories/GHSA-4rr5-89j8-mwwm",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-112396"
      ],
      "provider_metadata": {
        "cpes": [
          "cpe:2.3:a:python:pillow:*:*:*:*:*:python:*:*"
        ],
        "severity": "High"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-112396",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/database_specific/severity"
  },
  "source_id": "core-osv",
  "document_id": 461507,
  "published_at": "2026-10-26T05:55:38.352+00:00"
}