cimg — security advisory
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.
- Products
- cimg
- Affected versions
- 3.2.1+dfsg-1, 3.2.1+dfsg-2, 3.5.0+dfsg-1, 3.5.2+dfsg-1, 3.5.2+dfsg-1+deb13u1, 3.5.2+dfsg-2, 4.0.4+dfsg-1
- Fixed versions
- 4.0.4+dfsg-1
- CVEs
- CVE-2026-47667
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 09:52 UTC · Revision 2
Source evidence
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.
osv:DEBIAN-CVE-2026-47667
cimg
Fixed versions: Not specified
cimg
Fixed versions: Not specified
cimg
Fixed versions: 4.0.4+dfsg-1
Complete source record
{
"id": "ea352bb07b1e797c8d71d7e751f15f5275512a1c34f8e166c8dc7c0912418ca9",
"url": "https://osv.dev/vulnerability/DEBIAN-CVE-2026-47667",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DEBIAN-CVE-2026-47667",
"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.",
"evidence": "osv:DEBIAN-CVE-2026-47667",
"products": [
{
"name": {
"value": "cimg",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.2.1+dfsg-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.2.1+dfsg-2",
"evidence": "/affected/0/versions"
},
{
"value": "3.5.0+dfsg-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.5.2+dfsg-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.5.2+dfsg-2",
"evidence": "/affected/0/versions"
},
{
"value": "4.0.4+dfsg-1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "cimg",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.5.2+dfsg-1",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.2+dfsg-1+deb13u1",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.2+dfsg-2",
"evidence": "/affected/1/versions"
},
{
"value": "4.0.4+dfsg-1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "cimg",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "4.0.4+dfsg-1",
"evidence": "/affected/2/ranges"
}
],
"affected_versions": [
{
"value": "3.5.2+dfsg-1",
"evidence": "/affected/2/versions"
},
{
"value": "3.5.2+dfsg-2",
"evidence": "/affected/2/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "DEBIAN-CVE-2026-47667",
"aliases": [
"DEBIAN-CVE-2026-47667"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/debian/cimg?arch=source&distro=bookworm",
"ecosystem": "Debian:12"
},
"versions": [
"3.2.1+dfsg-1",
"3.2.1+dfsg-2",
"3.5.0+dfsg-1",
"3.5.2+dfsg-1",
"3.5.2+dfsg-2",
"4.0.4+dfsg-1"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-47667.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/debian/cimg?arch=source&distro=trixie",
"ecosystem": "Debian:13"
},
"versions": [
"3.5.2+dfsg-1",
"3.5.2+dfsg-1+deb13u1",
"3.5.2+dfsg-2",
"4.0.4+dfsg-1"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-47667.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "4.0.4+dfsg-1"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/debian/cimg?arch=source&distro=forky",
"ecosystem": "Debian:14"
},
"versions": [
"3.5.2+dfsg-1",
"3.5.2+dfsg-2"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2026-47667.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
}
],
"modified": "2026-10-25T09:47:31.144555734Z",
"provider": "osv",
"upstream": [
"CVE-2026-47667"
],
"references": [
"https://security-tracker.debian.org/tracker/CVE-2026-47667"
]
},
"related_cves": [
{
"value": "CVE-2026-47667",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 445112,
"published_at": "2026-07-21T20:17:01.323+00:00"
}