GHSA-HFF9-5PQW-6W9F

Vulnerability from github – Published: 2026-10-30 22:57 – Updated: 2026-10-30 22:57
VLAI
Summary
imgproxy has integer overflow in imgproxy ICO loader that causes denial of service and may permit remote code execution
Details

Summary

The 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.

Technical details

The vulnerable path is in vips/icoload.c at commit f4fedbb:

uint32_t data_size = GUINT32_FROM_LE(largest_image_header.data_size);

VipsPel *data = (VipsPel *) VIPS_MALLOC(NULL, data_size + BMP_FILE_HEADER_LEN);
void *actual_data = data + BMP_FILE_HEADER_LEN;

if (vips_foreign_load_read_full(ico->source, actual_data, data_size) <= 0) {
  vips_error("vips_foreign_load_ico_header", "unable to read ICO image data from the source");
  return -1;
}

The crafted directory entry contains:

data_size       = 0xfffffff5 (4294967285)
data_offset     = 22
BMP header size = 14
32-bit result   = (0xfffffff5 + 14) mod 2^32 = 3

The 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.

The complete source-to-sink path is:

  1. Attacker-controlled bytes begin with the ICO magic 00 00 01 00.
  2. imgproxy identifies the source as ICO and dispatches it to vips_icoload_source_go.
  3. vips_foreign_load_ico_header reads the attacker-controlled data_size.
  4. The 32-bit addition wraps, and VIPS_MALLOC receives the value three.
  5. vips_foreign_load_read_full passes the original data_size to the Go source callback.
  6. The callback writes the available source bytes through the invalid pointer, corrupting the process heap.

Impact

A crafted image can terminate the imgproxy process handling it or potentially lead to remote code execution due to heap corruption.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/imgproxy/imgproxy/v3"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.0.0"
            },
            {
              "fixed": "4.0.16"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/imgproxy/imgproxy/v2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.0.0"
            },
            {
              "fixed": "4.0.16"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/imgproxy/imgproxy"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.0.0"
            },
            {
              "fixed": "4.0.16"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-122",
      "CWE-190"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-30T22:57:00Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "## 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 \u003e 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-\u003esource, actual_data, data_size) \u003c= 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.",
  "id": "GHSA-hff9-5pqw-6w9f",
  "modified": "2026-10-30T22:57:00Z",
  "published": "2026-10-30T22:57:00Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/imgproxy/imgproxy/security/advisories/GHSA-hff9-5pqw-6w9f"
    },
    {
      "type": "WEB",
      "url": "https://github.com/imgproxy/imgproxy/commit/a821b6a4cb07a1bf2bb9077431d1c1e734d79917"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/imgproxy/imgproxy"
    },
    {
      "type": "WEB",
      "url": "https://github.com/imgproxy/imgproxy/releases/tag/v4.0.16"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "imgproxy has integer overflow in imgproxy ICO loader that causes denial of service and may permit remote code execution"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.