CVE-2026-47667

CImg Library is a C++ library for image processing. Prior to version 4.0.0 in `_load_analyze()`, the header_size field is read as an `unsigned int` from the first 4 bytes of an Analyze/NIfTI file and passed directly to `new unsigned char[header_size]` without being bounded against the actual file size. A value up to ~4 GB is accepted. If the subsequent `fread` returns `short` as it will for any malformed file), the function throws a `CImgIOException` and the allocated buffer is never freed. A 6-byte crafted file is sufficient to trigger an allocation of ~1.3 GB per call, with the full allocation leaked on every error path. The issue is reachable via `load_analyze()` and the generic `load()` when the file extension is .hdr, .img, or .nii. Version 4.0.0 fixes the issue.
Configurations

No configuration.

History

24 Oct 2026, 19:10

Type Values Removed Values Added
Summary
  • (es) La Biblioteca CImg es una biblioteca de C++ para procesamiento de imágenes. Antes de la versión 4.0.0 en ’_load_analyze()’, el campo header_size se lee como un ’unsigned int’ de los primeros 4 bytes de un archivo Analyze/NIfTI y se pasa directamente a ’new unsigned char[header_size]’ sin ser acotado contra el tamaño real del archivo. Se acepta un valor de hasta ~4 GB. Si el ’fread’ subsiguiente devuelve ’short’ (como ocurrirá para cualquier archivo malformado), la función lanza una ’CImgIOException’ y el búfer asignado nunca se libera. Un archivo manipulado de 6 bytes es suficiente para activar una asignación de ~1.3 GB por llamada, con la asignación completa filtrada en cada ruta de error. El problema es alcanzable a través de ’load_analyze()’ y el ’load()’ genérico cuando la extensión del archivo es .hdr, .img o .nii. La versión 4.0.0 soluciona el problema.

Information

Published : 2026-07-21 20:17

Updated : 2026-10-24 19:10


NVD link : CVE-2026-47667

Mitre link : CVE-2026-47667

CVE.ORG link : CVE-2026-47667


JSON object : View

Products Affected

No product.

CWE
CWE-401

Missing Release of Memory after Effective Lifetime

CWE-789

Memory Allocation with Excessive Size Value

CWE-1284

Improper Validation of Specified Quantity in Input