# CVE-2026-28231: pillow_heif Has Integer Overflow in Encode Path Buffer Validation that Leads to Heap Out-of-Bounds Read

> An integer overflow in pillow_heif allows attackers to trigger heap out-of-bounds reads, leading to information disclosure or crashes.

- **Severity:** Medium 5.5 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Feb 2026
- **Updated:** 3 Mar 2026
- **Also known as:** GHSA-5gjj-6r7v-ph3x, PYSEC-2026-2248, PYSEC-2026-2258, openSUSE-SU-2026:10285-1

## What is CVE-2026-28231?

CVE-2026-28231 is a medium-severity vulnerability in bigcat88 pillow_heif, published on 27 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

pillow_heif is a Python library for working with HEIF images and plugin for Pillow. Prior to version 1.3.0, an integer overflow in the encode path buffer validation of `_pillow_heif.c` allows an attacker to bypass bounds checks by providing large image dimensions, resulting in a heap out-of-bounds read. This can lead to information disclosure (server heap memory leaking into encoded images) or denial of service (process crash). No special configuration is required — this triggers under default settings. Version 1.3.0 fixes the issue.

Weakness: CWE-190 (Integer Overflow or Wraparound), CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2026-28231?

6 open source packages ship an affected version, including pi-heif and pillow-heif. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pi-heif` | PyPI | All versions | 1.3.0 |
| `pi-heif` | PyPI | All versions | 1.3.0 |
| `pi-heif` | PyPI | All versions | 1.3.0 |
| `pillow-heif` | PyPI | All versions | 1.3.0 |
| `pillow-heif` | PyPI | All versions | 1.3.0 |
| `pillow-heif` | PyPI | All versions | 1.3.0 |
| `python-pillow-heif` | openSUSE:Tumbleweed | All versions | 1.3.0-1.1 |

Products: Bigcat88 Pillow-Heif.

## How do I fix CVE-2026-28231?

Upgrade pi-heif to 1.3.0 or later.

## Is CVE-2026-28231 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-28231 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-28231 and fix it if it is affected.

What it is: CVE-2026-28231 is a medium-severity vulnerability in bigcat88 pillow_heif, published on 27 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-28231 exists.

Affected packages and fixed versions:
- pi-heif (PyPI): affected all versions; fixed in 1.3.0
- pi-heif (PyPI): affected all versions; fixed in 1.3.0
- pi-heif (PyPI): affected all versions; fixed in 1.3.0
- pillow-heif (PyPI): affected all versions; fixed in 1.3.0
- pillow-heif (PyPI): affected all versions; fixed in 1.3.0
- pillow-heif (PyPI): affected all versions; fixed in 1.3.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-28231/ (Markdown: https://insights.sbomify.com/CVE-2026-28231/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-28231
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-28231
- OSV: https://osv.dev/vulnerability/CVE-2026-28231

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-28231/
Summaries are generated and may contain mistakes; the official description above is the record.
