← Back to CVE Explorer

CVE-2026-42146

Full vulnerability record from the local CVENow database.

Description

CImg Library is a C++ library for image processing. Prior to commit c3aacf5, the nb_colors field read from the BMP file header is used directly to compute an allocation size without validating it against the remaining file size. A crafted BMP file with a large nb_colors value triggers an out-of-memory condition, crashing any application that uses CImg to load untrusted BMP files. This issue has been patched via commit c3aacf5.

Severity
MEDIUM
CVSS score
5.5 (v3.1)
Vulnerability status
Deferred
Source identifier
Published
2026-05-04 18:16:31.977000
Last modified
2026-10-26 19:10:00.163000
View original CVE JSON
{
  "id": "CVE-2026-42146",
  "sourceIdentifier": "[email protected]",
  "published": "2026-05-04T18:16:31.977",
  "lastModified": "2026-10-26T19:10:00.163",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "CImg Library is a C++ library for image processing. Prior to commit c3aacf5, the nb_colors field read from the BMP file header is used directly to compute an allocation size without validating it against the remaining file size. A crafted BMP file with a large nb_colors value triggers an out-of-memory condition, crashing any application that uses CImg to load untrusted BMP files. This issue has been patched via commit c3aacf5."
    },
    {
      "lang": "es",
      "value": "CImg Biblioteca es una biblioteca de C++ para procesamiento de imágenes. Antes del commit c3aacf5, el campo nb_colors leído del encabezado del archivo BMP se utiliza directamente para calcular un tamaño de asignación sin validarlo contra el tamaño restante del archivo. Un archivo BMP manipulado con un valor grande de nb_colors desencadena una condición de falta de memoria, provocando el bloqueo de cualquier aplicación que utilice CImg para cargar archivos BMP no confiables. Este problema ha sido parcheado mediante el commit c3aacf5."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "GreycLab",
          "product": "CImg",
          "versions": [
            {
              "version": "< c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H",
          "baseScore": 5.5,
          "baseSeverity": "MEDIUM",
          "attackVector": "LOCAL",
          "attackComplexity": "LOW",
          "privilegesRequired": "NONE",
          "userInteraction": "REQUIRED",
          "scope": "UNCHANGED",
          "confidentialityImpact": "NONE",
          "integrityImpact": "NONE",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 1.8,
        "impactScore": 3.6
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-05-06T13:43:28.189688Z",
          "id": "CVE-2026-42146",
          "options": [
            {
              "exploitation": "poc"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-789"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/GreycLab/CImg/commit/c3aacf5b96ac1e54b7af1957c6737dbf3949f6d3",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/GreycLab/CImg/issues/477",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/GreycLab/CImg/releases/tag/v.3.7.5",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/GreycLab/CImg/security/advisories/GHSA-g54r-qmgx-c6fv",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/GreycLab/CImg/issues/477",
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"
    }
  ]
}