CVE-2017-8327 (published 2017-04-29T20:59Z)

The bmpr_read_uncompressed function in imagew-bmp.c in libimageworsener.a in ImageWorsener before 1.3.1 allows remote attackers to cause a denial of service (memory consumption) via a crafted image.

Severity: HIGH
CVSS v2 base score: 7.1 (AV:N/AC:M/Au:N/C:N/I:N/A:C)
CVSS v3 base score: 6.5, MEDIUM (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H)

Weakness information:
cwe_id: CWE-400
cwe_name: Uncontrolled Resource Consumption
description: The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
extended_description: 
            Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the product, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
            There are at least three distinct scenarios which can commonly lead to resource exhaustion:
               
                  Lack of throttling for the number of allocated resources
                  Losing all references to a resource before reaching the shutdown stage
                  Not closing/returning a resource after processing
               
            Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
               
                  Error conditions and other exceptional circumstances.
                  Confusion over which part of the program is responsible for releasing the resource.
               
         
         

Fix information:
repo_url: https://github.com/jsummers/imageworsener
commit_details: repo_url: https://github.com/jsummers/imageworsener
author: Jason Summers
author_date: 2017-04-12 10:54:31-04:00
msg: Reduced the max memory use and image size in 64-bit builds

This is a stopgap measure that should prevent some problems with excessive
resource use, and possibly integer overflow.
Related: issue #14
repository: repo_url: https://github.com/jsummers/imageworsener
repo_name: jsummers/imageworsener
description: A utility for processing PNG, JPEG, BMP, and WebP images. Features include resize/resample, dither, grayscale, apply background color, subpixel rendering.
repo_language: C
owner: jsummers
file_changes: filename: imagew-internals.h
change_type: ModificationType.MODIFY
diff: @@ -19,8 +19,8 @@
 typedef double iw_tmpsample;
 
 #ifdef IW_64BIT
-#define IW_DEFAULT_MAX_DIMENSION 1000000
-#define IW_DEFAULT_MAX_MALLOC 2000000000000
+#define IW_DEFAULT_MAX_DIMENSION 40000
+#define IW_DEFAULT_MAX_MALLOC 2000000000
 #else
 #define IW_DEFAULT_MAX_DIMENSION 40000 // Must be less than sqrt(2^31).
 #define IW_DEFAULT_MAX_MALLOC 2000000000

programming_language: C