CVE-2026-42146
Description
A flaw was found in CImg Library. A remote attacker can exploit this vulnerability by providing a specially crafted BMP (Bitmap) image file. This occurs because the nb_colors field in the BMP file header is used directly to compute an allocation size without proper validation against the remaining file size. Successful exploitation can lead to an out-of-memory condition, causing applications that use CImg to load untrusted BMP files to crash, resulting in a Denial of Service (DoS).
Statement
Red Hat Product Security has determined that this vulnerability does not affect any currently supported Red Hat product. This assessment may evolve based on further analysis and discovery. For more information about this vulnerability and the products it affects, please see the linked references.
Mitigation
To mitigate this issue, avoid processing untrusted BMP image files with applications that utilize the CImg Library. Implement strict input validation for all incoming image files and consider sandboxing applications that handle external image files to limit the potential impact of out-of-memory conditions. If a service processes such files, ensure it is restarted after any configuration changes to apply the new operational controls.
Understanding the Weakness (CWE)
Availability
Technical Impact: DoS: Resource Consumption (CPU); DoS: Resource Consumption (Memory); DoS: Resource Consumption (Other)
When allocating resources without limits, an attacker could prevent other systems, applications, or processes from accessing the same type of resource. It can be easy for an attacker to consume many resources by rapidly making many requests or causing larger resources to be used than is needed.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.