{"id":"GHSA-hff9-5pqw-6w9f","kind":"vulnerability","aliases":["GHSA-hff9-5pqw-6w9f"],"related":[],"title":"imgproxy has integer overflow in imgproxy ICO loader that causes denial of service and may permit remote code execution","description":"## Summary\n\nThe ICO loader allocates `data_size + BMP_FILE_HEADER_LEN` bytes after reading a 32-bit attacker-controlled `data_size`. For `data_size > UINT32_MAX - BMP_FILE_HEADER_LEN`, the addition wraps before allocation. imgproxy then writes the ICO prefix and reads up to the original declared size starting 14 bytes into the undersized allocation. A network client can turn this heap overflow into remote denial of service or remote code execution.\n\n## Technical details\n\nThe vulnerable path is in [`vips/icoload.c` at commit `f4fedbb`](https://github.com/imgproxy/imgproxy/blob/f4fedbb5c7f6684e7a8e0a9bb7e666773f3c40c0/vips/icoload.c#L154-L164):\n\n```c\nuint32_t data_size = GUINT32_FROM_LE(largest_image_header.data_size);\n\nVipsPel *data = (VipsPel *) VIPS_MALLOC(NULL, data_size + BMP_FILE_HEADER_LEN);\nvoid *actual_data = data + BMP_FILE_HEADER_LEN;\n\nif (vips_foreign_load_read_full(ico->source, actual_data, data_size) <= 0) {\n  vips_error(\"vips_foreign_load_ico_header\", \"unable to read ICO image data from the source\");\n  return -1;\n}\n```\n\nThe crafted directory entry contains:\n\n```text\ndata_size       = 0xfffffff5 (4294967285)\ndata_offset     = 22\nBMP header size = 14\n32-bit result   = (0xfffffff5 + 14) mod 2^32 = 3\n```\n\nThe allocation is therefore three bytes. `actual_data` points 14 bytes after the allocation base. The fixture contains 64 bytes after the ICO header, so the source callback copies those 64 bytes to an invalid destination before it can report that the declared multi-gigabyte payload is incomplete.\n\nThe complete source-to-sink path is:\n\n1. Attacker-controlled bytes begin with the ICO magic `00 00 01 00`.\n2. imgproxy identifies the source as ICO and dispatches it to `vips_icoload_source_go`.\n3. `vips_foreign_load_ico_header` reads the attacker-controlled `data_size`.\n4. The 32-bit addition wraps, and `VIPS_MALLOC` receives the value three.\n5. `vips_foreign_load_read_full` passes the original `data_size` to the Go source callback.\n6. The callback writes the available source bytes through the invalid pointer, corrupting the process heap.\n\n## Impact\n\nA crafted image can terminate the imgproxy process handling it or potentially lead to remote code execution due to heap corruption.","summary":"imgproxy's ICO image loader computes a wrapped 32-bit allocation size from an attacker-supplied field, then writes source data past a tiny buffer. A remote client who submits a crafted ICO image can crash the imgproxy process or potentially corrupt the heap to run code.","severity":"critical","cvss":9.8,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"github.com/imgproxy/imgproxy/v3","fixed":["4.0.16"],"affected":">= 4.0.0, < 4.0.16","ecosystem":"go"},{"name":"github.com/imgproxy/imgproxy/v2","fixed":["4.0.16"],"affected":">= 4.0.0, < 4.0.16","ecosystem":"go"},{"name":"github.com/imgproxy/imgproxy","fixed":["4.0.16"],"affected":">= 4.0.0, < 4.0.16","ecosystem":"go"}],"ecosystems":["go"],"tags":["cwe-122","cwe-190","go","imgproxy","libvips","package","self-hosted"],"not_affected_if":["fixed-version","trusted-input-only"],"how_to_check":"- Check the imgproxy version: run `imgproxy -v` or inspect the Go module version with `go list -m github.com/imgproxy/imgproxy/v3` (or v2 / the root module, depending on how it is built)\n- Confirm whether the image processing endpoint accepts ICO input from remote clients (look for `ico` in allowed formats in the imgproxy configuration)","fix":"- imgproxy `4.0.16` (affected: `>= 4.0.0, < 4.0.16`)","status":"open","published_at":"2026-10-30T22:57:00+00:00","first_seen_at":"2026-10-30T23:02:03+00:00","triaged_at":"2026-10-30T23:02:45+00:00","updated_at":"2026-10-30T23:02:45+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-30T23:02:45Z","model":"claude-haiku-5-5","output":{"fix":"- imgproxy `4.0.16` (affected: `>= 4.0.0, < 4.0.16`)","reach":"internet","title":"imgproxy: crafted ICO image overflows heap, enabling crash or code execution","impact":"high","summary":"imgproxy's ICO image loader computes a wrapped 32-bit allocation size from an attacker-supplied field, then writes source data past a tiny buffer. A remote client who submits a crafted ICO image can crash the imgproxy process or potentially corrupt the heap to run code.","audience":"businesses","category":"package","nicknames":[],"who_cares":["imgproxy","self-hosted","go","libvips"],"confidence":0.8,"fix_status":"available","needs_auth":"no","worst_case":"remote code execution or process crash via a crafted ICO image","analyst_note":"Confirm whether ICO is enabled by default in imgproxy 4.0.x and whether exploitation is confirmed beyond the crash, using the maintainer advisory at github.com/advisories/GHSA-hff9-5pqw-6w9f.","how_to_check":"- Check the imgproxy version: run `imgproxy -v` or inspect the Go module version with `go list -m github.com/imgproxy/imgproxy/v3` (or v2 / the root module, depending on how it is built)\n- Confirm whether the image processing endpoint accepts ICO input from remote clients (look for `ico` in allowed formats in the imgproxy configuration)","plain_action":"","needs_analyst":true,"not_affected_if":["fixed-version","trusted-input-only"],"who_is_affected":"Any deployment of imgproxy 4.0.0 through 4.0.15 that decodes images from untrusted sources, since an ICO file sent to the processing endpoint reaches the vulnerable loader. Deployments that only process trusted, internally generated images or that run a version at or above 4.0.16 are not exposed.","user_interaction":"no","needs_special_setup":"unknown","severity_if_unknown":"critical"},"cost_usd":0.000869,"input_tokens":5189,"output_tokens":700,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-1':246C '-122':40B '-190':42B '/imgproxy/imgproxy':38A '/imgproxy/imgproxy/blob/f4fedbb5c7f6684e7a8e0a9bb7e666773f3c40c0/vips/icoload.c#l154-l164):':185C '/imgproxy/imgproxy/v2':35A '/imgproxy/imgproxy/v3':32A '0':228C '00':340C,341C,343C '01':342C '0xfffffff5':255C,267C '1':330C '14':149C,263C,268C,282C '2':270C,344C '22':259C '3':272C,359C '32':58B,113C,264C,271C,374C '4':372C '4294967285':256C '5':385C '5pqw':23A,28A '6':401C '64':291C,303C '6w9f':24A,29A 'actual':209C,224C,279C 'addit':130C,376C 'alloc':60B,102C,133C,154C,274C,286C 'attack':65B,116C,332C,368C 'attacker-control':115C,331C,367C 'attacker-suppli':64B 'avail':406C 'base':287C 'begin':335C 'bit':59B,114C,265C,375C 'bmp':105C,125C,204C,212C,260C 'buffer':75B 'byte':109C,150C,278C,283C,292C,304C,334C,408C 'c':186C 'callback':300C,400C,403C 'caus':10A 'client':78B,157C 'code':18A,97B,170C,433C 'commit':181C 'complet':323C 'comput':55B 'contain':251C,290C 'control':117C,333C,369C 'copi':301C 'corrupt':92B,413C,438C 'craft':82B,248C,419C 'crash':86B 'cwe':39B,41B 'data':71B,103C,118C,121C,189C,197C,202C,210C,211C,225C,226C,241C,253C,257C,280C,370C,394C 'declar':146C,315C 'denial':11A,165C 'destin':308C 'detail':173C 'directori':249C 'dispatch':352C 'due':435C 'entri':250C 'error':230C 'execut':19A,171C,434C 'f4fedbb':182C 'field':67B 'file':106C,126C,205C,213C 'fixtur':289C 'foreign':218C,232C,361C,387C 'full':221C,390C 'ghsa':21A,26A 'ghsa-hff9-5pqw-6w9f':20A,25A 'gigabyt':318C 'github.com':31A,34A,37A,184C 'github.com/imgproxy/imgproxy':36A 'github.com/imgproxy/imgproxy/blob/f4fedbb5c7f6684e7a8e0a9bb7e666773f3c40c0/vips/icoload.c#l154-l164):':183C 'github.com/imgproxy/imgproxy/v2':33A 'github.com/imgproxy/imgproxy/v3':30A 'go':43B,358C,398C 'guint32':191C 'handl':426C 'header':107C,127C,206C,214C,235C,261C,296C,364C 'heap':94B,161C,416C,437C 'hff9':22A,27A 'host':49B 'ico':7A,52B,83B,100C,138C,222C,234C,239C,295C,338C,350C,363C 'icoload':356C 'identifi':346C 'imag':53B,84B,240C,420C 'imgproxi':1A,6A,44B,50B,88B,134C,345C,424C 'impact':417C 'incomplet':321C 'integ':3A 'invalid':307C,411C 'largest_image_header.data':194C 'le':193C 'lead':430C 'len':108C,128C,207C,215C 'libvip':45B 'load':219C,233C,362C,388C 'loader':8A,54B,101C 'magic':339C 'malloc':200C,380C 'max':124C 'may':15A 'mod':269C 'multi':317C 'multi-gigabyt':316C 'network':156C 'null':201C 'offset':258C 'origin':145C,393C 'overflow':4A,162C 'packag':46B 'pass':391C 'past':72B 'path':176C,328C 'payload':319C 'permit':16A 'point':281C 'pointer':412C 'potenti':91B,429C 'prefix':139C 'process':89B,415C,425C 'read':111C,141C,220C,238C,365C,389C 'receiv':381C 'remot':17A,77B,164C,169C,432C 'report':312C 'result':266C 'return':245C 'run':96B 'self':48B 'self-host':47B 'servic':13A,167C 'sink':327C 'size':61B,104C,119C,122C,147C,190C,195C,203C,227C,254C,262C,371C,395C 'sourc':70B,223C,244C,299C,325C,348C,357C,399C,407C 'source-to-sink':324C 'start':148C 'submit':80B 'summari':98C 'suppli':66B 'technic':172C 'termin':422C 'text':252C 'therefor':276C 'three':277C,384C 'tini':74B 'turn':159C 'uint32':123C,187C 'unabl':236C 'unders':153C 'valu':383C 'vip':199C,217C,229C,231C,355C,360C,379C,386C 'vips/icoload.c':179C 'vipspel':196C,198C 'void':208C 'vulner':175C 'wrap':57B,131C,377C 'write':69B,136C,404C","nicknames":[],"mitigations":[],"who_affected":"Any deployment of imgproxy 4.0.0 through 4.0.15 that decodes images from untrusted sources, since an ICO file sent to the processing endpoint reaches the vulnerable loader. Deployments that only process trusted, internally generated images or that run a version at or above 4.0.16 are not exposed.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"businesses","plain_action":null,"first_public_at":"2026-10-30T22:57:00+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-hff9-5pqw-6w9f","url":"https://github.com/advisories/GHSA-hff9-5pqw-6w9f","severity":"critical","published_at":"2026-10-30T22:57:00+00:00","modified_at":"2026-10-30T22:57:03+00:00","first_seen_at":"2026-10-30T23:02:03+00:00","fetched_at":"2026-10-30T23:02:03+00:00","note":null}],"documents":[{"id":26677,"url":"https://api.github.com/repos/imgproxy/imgproxy/security-advisories/GHSA-hff9-5pqw-6w9f","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":26678,"url":"https://github.com/imgproxy/imgproxy/security/advisories/GHSA-hff9-5pqw-6w9f","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":26520,"url":"https://github.com/imgproxy/imgproxy/commit/a821b6a4cb07a1bf2bb9077431d1c1e734d79917","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":26521,"url":"https://github.com/imgproxy/imgproxy/releases/tag/v4.0.16","title":"Release: github.com","kind":"release","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release: github.com"}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}