---
id: "CVE-2026-118753"
kind: "vulnerability"
aliases: ["CVE-2026-118753"]
title: "FreeImage fork: crafted GIF frame overflows heap and corrupts memory"
severity: "high"
cvss: 8.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["c++", "freeimage", "image-processing", "package", "self-hosted"]
not_affected_if: ["default-config", "trusted-input-only"]
published_at: "2026-10-28T22:17:14+00:00"
first_seen_at: "2026-10-28T22:35:34+00:00"
updated_at: "2026-10-28T22:36:40+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118753", "first_seen_at": "2026-10-28T22:35:34+00:00"}]
---

# FreeImage fork: crafted GIF frame overflows heap and corrupts memory

The danoli3 fork of FreeImage does not clip GIF frame rectangles to the logical screen size in PluginGIF.cpp. A crafted GIF whose frame extends past the canvas makes the playback compositing code write beyond the canvas heap allocation when it is loaded with GIF_PLAYBACK.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check whether the application links the danoli3 FreeImage fork and its version, for example `grep -ri freeimage` in the build files or package manifest
- Check whether GIF loading uses the `GIF_PLAYBACK` flag in the FreeImage_Load call sites

## Fix

- Move the danoli3 FreeImage fork to `3.19.25` or later
- Until upgraded, stop loading untrusted GIFs with `GIF_PLAYBACK`

## Timeline

- 2026-10-28T22:35:34+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-118753

## From the sources

FreeImage (danoli3 fork) before 3.19.25 contains a heap buffer overflow vulnerability in PluginGIF.cpp that allows attackers to write past the canvas allocation via unclipped GIF frame rectangles. Attackers can craft a GIF whose frame left plus width exceeds the logical screen width, causing GifPlaybackCompositeFrame() and GifPlaybackFillRect() to corrupt heap memory when loaded with GIF_PLAYBACK.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
