{"id":"CVE-2026-47667","aliases":["CVE-2026-47667"],"related":[],"kind":"vulnerability","state":"published","title":"CImg Library: Uncontrolled Memory Allocation and Memory Leak in `_load_analyze()` via Crafted NIfTI/Analyze Header","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-07-21T19:57:49.446Z","modified":"2026-10-24T19:10:00.127Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-401","CWE-789","CWE-1284"],"affected":[{"ranges":[{"version":"< 4.0.0","status":"affected"}],"vendor":"GreycLab","product":"CImg","source":"cvelist"}],"references":[{"url":"https://github.com/GreycLab/CImg/security/advisories/GHSA-rmfc-grgj-qwhv","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/GreycLab/CImg/issues/480","tags":["exploit","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/GreycLab/CImg/commit/6a69bf725ffd111a4c7dc61cc15e3661abd158ee","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-23T14:12:55.547Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47667","url":"https://www.cve.org/CVERecord?id=CVE-2026-47667","licence":"CVE Terms of Use","modified":"2026-07-23T14:13:10.735Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47667","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47667","licence":"Public domain","modified":"2026-10-24T19:10:00.127Z"}],"updatedAt":"2026-11-25T22:59:29.390Z","epss":{"score":0.00609,"percentile":0.4339,"date":"2026-11-30T12:00:22.000Z"}}