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
- 1.6.4+dfsg-1build1, 1.6.5+dfsg-1, 1.7.9+dfsg-2, 1.7.9+dfsg-2build1, 1.7.9+dfsg-2ubuntu0.18.04.1, 1.7.9+dfsg-2ubuntu0.18.04.2, 1.7.9+dfsg-2ubuntu0.18.04.2+esm1, 2.4.5+dfsg-1, 2.9.4+dfsg-2, 2.9.4+dfsg-3, 2.9.4+dfsg-3ubuntu0.1~esm1, 3.2.1+dfsg-1, 3.2.1+dfsg-1ubuntu0.24.04.1~esm1, 3.5.2+dfsg-1, 3.5.2+dfsg-1build1, 3.5.2+dfsg-2
- Fixed versions
- Not specified
- CVEs
- CVE-2026-47667
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 03:06 UTC · Revision 1
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:UBUNTU-CVE-2026-47667
cimg
Fixed versions: Not specified
cimg
Fixed versions: Not specified
cimg
Fixed versions: Not specified
cimg
Fixed versions: Not specified
cimg
Fixed versions: Not specified
cimg
Fixed versions: Not specified
cimg
Fixed versions: Not specified
Complete source record
{
"id": "a790e3f20b71f604a9ca9a0d715641e63f8436ea2c37e66a42af03930270db6d",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-47667",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-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:UBUNTU-CVE-2026-47667",
"products": [
{
"name": {
"value": "cimg",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.6.4+dfsg-1build1",
"evidence": "/affected/0/versions"
},
{
"value": "1.6.5+dfsg-1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "cimg",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.7.9+dfsg-2",
"evidence": "/affected/1/versions"
},
{
"value": "1.7.9+dfsg-2build1",
"evidence": "/affected/1/versions"
},
{
"value": "1.7.9+dfsg-2ubuntu0.18.04.1",
"evidence": "/affected/1/versions"
},
{
"value": "1.7.9+dfsg-2ubuntu0.18.04.2",
"evidence": "/affected/1/versions"
},
{
"value": "1.7.9+dfsg-2ubuntu0.18.04.2+esm1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "cimg",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.4.5+dfsg-1",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "cimg",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2.9.4+dfsg-2",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.4+dfsg-3",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.4+dfsg-3ubuntu0.1~esm1",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "cimg",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.2.1+dfsg-1",
"evidence": "/affected/4/versions"
},
{
"value": "3.2.1+dfsg-1ubuntu0.24.04.1~esm1",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "cimg",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.5.2+dfsg-1build1",
"evidence": "/affected/5/versions"
},
{
"value": "3.5.2+dfsg-2",
"evidence": "/affected/5/versions"
}
]
},
{
"name": {
"value": "cimg",
"evidence": "/affected/6/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.5.2+dfsg-1",
"evidence": "/affected/6/versions"
},
{
"value": "3.5.2+dfsg-1build1",
"evidence": "/affected/6/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "UBUNTU-CVE-2026-47667",
"aliases": [
"UBUNTU-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"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/ubuntu/cimg?arch=source&distro=xenial",
"ecosystem": "Ubuntu:16.04:LTS"
},
"versions": [
"1.6.4+dfsg-1build1",
"1.6.5+dfsg-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-47667.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "cimg-examples",
"binary_version": "1.6.5+dfsg-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/ubuntu/cimg?arch=source&distro=esm-apps%2Fbionic",
"ecosystem": "Ubuntu:Pro:18.04:LTS"
},
"versions": [
"1.7.9+dfsg-2",
"1.7.9+dfsg-2build1",
"1.7.9+dfsg-2ubuntu0.18.04.1",
"1.7.9+dfsg-2ubuntu0.18.04.2",
"1.7.9+dfsg-2ubuntu0.18.04.2+esm1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-47667.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "cimg-examples",
"binary_version": "1.7.9+dfsg-2ubuntu0.18.04.2+esm1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/ubuntu/cimg?arch=source&distro=focal",
"ecosystem": "Ubuntu:20.04:LTS"
},
"versions": [
"2.4.5+dfsg-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-47667.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "cimg-examples",
"binary_version": "2.4.5+dfsg-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/ubuntu/cimg?arch=source&distro=esm-apps%2Fjammy",
"ecosystem": "Ubuntu:Pro:22.04:LTS"
},
"versions": [
"2.9.4+dfsg-2",
"2.9.4+dfsg-3",
"2.9.4+dfsg-3ubuntu0.1~esm1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-47667.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "cimg-examples",
"binary_version": "2.9.4+dfsg-3ubuntu0.1~esm1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/ubuntu/cimg?arch=source&distro=esm-apps%2Fnoble",
"ecosystem": "Ubuntu:Pro:24.04:LTS"
},
"versions": [
"3.2.1+dfsg-1",
"3.2.1+dfsg-1ubuntu0.24.04.1~esm1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-47667.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "cimg-examples",
"binary_version": "3.2.1+dfsg-1ubuntu0.24.04.1~esm1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/ubuntu/cimg?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"3.5.2+dfsg-1build1",
"3.5.2+dfsg-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-47667.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "cimg-examples",
"binary_version": "3.5.2+dfsg-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cimg",
"purl": "pkg:deb/ubuntu/cimg?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"3.5.2+dfsg-1",
"3.5.2+dfsg-1build1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-47667.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "cimg-examples",
"binary_version": "3.5.2+dfsg-1build1"
}
]
}
}
],
"modified": "2026-10-17T13:00:19.503646420Z",
"provider": "osv",
"upstream": [
"CVE-2026-47667"
],
"references": [
"https://ubuntu.com/security/CVE-2026-47667",
"https://www.cve.org/CVERecord?id=CVE-2026-47667",
"https://github.com/GreycLab/CImg/security/advisories/GHSA-rmfc-grgj-qwhv",
"https://github.com/GreycLab/CImg/issues/480"
]
},
"related_cves": [
{
"value": "CVE-2026-47667",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 360426,
"published_at": "2026-07-21T20:17:00+00:00"
}