Bug 1344214 - libjpeg: CPU overconsumption using extraneous progressive scans
Summary: libjpeg: CPU overconsumption using extraneous progressive scans
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1344218 1344220
Blocks: 1344217
TreeView+ depends on / blocked
 
Reported: 2016-06-09 08:18 UTC by Andrej Nemec
Modified: 2021-02-17 03:44 UTC (History)
22 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-06-13 04:26:39 UTC
Embargoed:


Attachments (Terms of Use)

Description Andrej Nemec 2016-06-09 08:18:27 UTC
JPEG has the ability to encode images progressively–that is, to encode images into multiple “scans” of differing resolutions, such that the lowest-resolution scan is decoded first and subsequent scans fill in the image detail. The progressive JPEG format also provides a feature, called an “EOB run”, that allows it to represent large blocks of zeroes using only a few bytes.

One can combine these two features to generate an image with a very large number of progressive scans (say, 80,000), each of which uses the EOB run feature to represent millions of zero-value pixels using less than 100 bytes. Because millions of pixels are being represented, each of these scans takes significant time to decode, and the decode time goes up linearly with the number of 100-byte scans one adds to the image.

Mitigation:

These images are entirely legal, as the JPEG standard permits an unlimited number of progressive scans. However, it is hard to imagine any real-world application needing more than 100. Therefore, limiting the number to 1,000 before exiting with an error should avoid this problem while not preventing the decoding of any legal, non-hostile JPEGs.

External references:

https://docs.google.com/document/d/17exDyGr2txYJ5Ntv4Q8B3MnLSvbcSfs5dje_xuDZPNA

Comment 1 Andrej Nemec 2016-06-09 08:24:42 UTC
Created libjpeg-turbo tracking bugs for this issue:

Affects: fedora-all [bug 1344218]

Comment 2 Andrej Nemec 2016-06-09 08:24:53 UTC
Created mingw-libjpeg-turbo tracking bugs for this issue:

Affects: fedora-all [bug 1344220]


Note You need to log in before you can comment on or make changes to this bug.