---
id: "CVE-2026-118752"
kind: "vulnerability"
aliases: ["CVE-2026-118752"]
title: "FreeImage fork: heap overflow in PBM image decoder lets crafted files write 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: ["no-untrusted-images", "upstream-freeimage-only"]
published_at: "2026-10-28T22:17:13+00:00"
first_seen_at: "2026-10-28T22:35:34+00:00"
updated_at: "2026-10-28T22:36:41+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118752", "first_seen_at": "2026-10-28T22:35:34+00:00"}]
---

# FreeImage fork: heap overflow in PBM image decoder lets crafted files write memory

The danoli3 fork of FreeImage before 3.19.22 has a heap buffer overflow in the PBM RLE decoder in PluginIFF.cpp, which does not bounds-check ByteRun1 runs. A crafted IFF/LBM PBM file can write up to 127 attacker-controlled bytes past the heap bitmap.

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

## How to check

- Check the FreeImage fork version in the project lockfile or vendored source, for example `grep -ri freeimage` in dependency manifests
- Confirm whether the app decodes IFF/LBM or PBM images from untrusted input (`unknown` if the sources do not say which code paths reach the decoder)

## Fix

- Upgrade the danoli3 FreeImage fork to `3.19.22` or later
- Until upgraded, reject or do not decode untrusted IFF/LBM and PBM uploads

## Timeline

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

## From the sources

FreeImage (danoli3 fork) before 3.19.22 contains a heap buffer overflow vulnerability in the PBM RLE decoder of PluginIFF.cpp that lacks bounds checks on ByteRun1 runs. Attackers can supply a crafted IFF/LBM PBM file with runs straddling scanline ends to write up to 127 controlled bytes past the heap-allocated bitmap.

---

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