The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-42146

CVE-2026-42146: CImg Library DOS Vulnerability

CVE-2026-42146 is a denial of service vulnerability in CImg Library caused by improper validation of BMP file headers. Attackers can crash applications using crafted files. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: May 7, 2026

CVE-2026-42146 Overview

CVE-2026-42146 is a memory allocation vulnerability in the CImg Library, a C++ image processing library maintained by the GreycLab project. The flaw resides in the BMP file loader, which reads the nb_colors field from the BMP header and uses it directly to compute an allocation size. The library does not validate this value against the remaining file size. A crafted BMP file containing an oversized nb_colors value forces the library to attempt an excessive allocation, triggering an out-of-memory condition. Any application that uses CImg to load untrusted BMP files will crash. The issue is tracked under [CWE-789] (Memory Allocation with Excessive Size Value) and was fixed in commit c3aacf5.

Critical Impact

Applications using CImg to parse untrusted BMP files can be crashed by a single malicious image, producing a reliable denial-of-service condition.

Affected Products

  • CImg Library versions prior to commit c3aacf5
  • CImg Library releases earlier than v.3.7.5
  • Applications that link CImg to process untrusted BMP input

Discovery Timeline

  • 2026-05-04 - CVE-2026-42146 published to NVD
  • 2026-05-07 - Last updated in NVD database

Technical Details for CVE-2026-42146

Vulnerability Analysis

The CImg BMP loader parses the bitmap file header and reads the nb_colors field, which describes the size of the color palette. The loader then multiplies this value to determine the byte count for a palette buffer allocation. Because the field is attacker-controlled and unvalidated, a crafted BMP can request an allocation far larger than the actual file. The allocation request either fails outright or exhausts available memory, terminating the host process. The result is a deterministic crash whenever the library processes the malicious file. Exploitation requires the user or service to load the BMP, matching the local attack vector and user-interaction requirement reflected in the CVSS vector.

Root Cause

The root cause is missing bounds validation on the nb_colors header field before it is used as an allocation size. The loader trusts header metadata without cross-checking it against the remaining bytes available in the file. This pattern is classified as [CWE-789]: a memory allocation where the size is derived from untrusted input without an upper bound. The patch in commit c3aacf5 introduces validation that rejects palettes too large to fit within the file.

Attack Vector

An attacker crafts a BMP file with a manipulated nb_colors field set to an extremely large value. The attacker delivers the file to a target application that uses CImg, for example through a document upload, email attachment, or local file open. When the application invokes the CImg BMP loader, the oversized allocation request triggers an out-of-memory error and the process terminates. No code execution or data disclosure occurs, but availability is fully impacted for the affected process. Verified technical detail is documented in the GitHub Security Advisory and the GitHub Issue Tracker.

Detection Methods for CVE-2026-42146

Indicators of Compromise

  • Repeated unexpected termination of processes that invoke the CImg BMP loader.
  • BMP files whose declared nb_colors value implies a palette larger than the file itself.
  • Application logs reporting std::bad_alloc or out-of-memory errors immediately after image load operations.

Detection Strategies

  • Inspect BMP headers at ingestion and flag files where nb_colors exceeds a reasonable bound such as 256 for 8-bit images.
  • Compare the declared palette size against the remaining file length before passing the file to CImg.
  • Track CImg version strings across the software inventory and identify builds older than v.3.7.5.

Monitoring Recommendations

  • Monitor crash telemetry on services that process user-supplied images and correlate with BMP MIME types.
  • Alert on repeated SIGABRT or allocation-failure exits from image-processing workers.
  • Audit dependency manifests for CImg headers built before commit c3aacf5.

How to Mitigate CVE-2026-42146

Immediate Actions Required

  • Upgrade CImg to release v.3.7.5 or later, which includes commit c3aacf5.
  • Rebuild and redeploy any application or container image that statically links the affected CImg headers.
  • Restrict BMP processing of untrusted input until the patched version is in place.

Patch Information

The fix is published in CImg v.3.7.5 and applied in commit c3aacf5. The patch validates the nb_colors value against the remaining file size before allocation, rejecting malformed BMP files instead of attempting an oversized allocation.

Workarounds

  • Pre-validate BMP files in a wrapper that parses the header and rejects files where palette size exceeds the file body.
  • Run CImg-based decoders in isolated worker processes with strict memory limits so a crash does not affect the parent service.
  • Disable BMP support in user-facing upload paths until the patched library is deployed.
bash
# Example: enforce a per-process memory ceiling on an image worker
systemd-run --scope -p MemoryMax=512M ./image-worker --input untrusted.bmp

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechCimg

  • SeverityMEDIUM

  • CVSS Score5.5

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-789
  • Technical References
  • GitHub Commit Details

  • GitHub Issue Tracker

  • GitHub Release Notes

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-42144: CImg Library Buffer Overflow Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English