-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory exhauted and hangs long time when use 64bit opj_decompress (CVE-2019-6988) #1178
Comments
I have a simple JPEG2000 reader. Using it I found:
winfried |
Should memory checks be added to the program? Otherwise the memory will be exhausted. |
winfried |
This was assigned CVE-2019-6988. |
@yanxxd is this issue invalid, or was it fixed at some point? If this issue is invalid, we should ask for CVE rejection. |
@yanxxd pinging you again, has this issue been fixed by now or was it invalid? |
I tested it use the latest version, git commit 563ecfb. The program run about 10 minutes, CPU 100%, MEM 100%. The following is the output:
You can reproduce it use the POC. |
Thanks! Perhaps this issue should be reopened then. |
While for this particular file (POC), we could bail out earlier given a number of corruptions in segment markers, this wouldn't fix the underlying issue. This issue is a design one. The library pre-allocates precints and codeblocks related structures, such as tagtree, for a whole tile. In the case of POC, there are for example 37 million codeblocks for one precinct, which represents 4 GB of RAM for the codeblock working memory (and other GB for tagtree etc). Completely legit JPEG2000 images could be built with the same characteristics as those corrupted images, and with sufficient huge amount of RAM could be docoded. As fixing the design of openjpeg would be enormous work, a fix would probably to set some implementation-defined thresholds, not normally reached on "normal" images, and error out if they are reached, and let the user able to override them with some environment variable. |
Setting some implementation-defined thresholds may be a viable solution. |
Any news on this? |
Hiya! |
@yanxxd can you reproduce CVE-2019-6988 using opj 2.4.0 ? |
Hi, Any update on the issue? |
[INFO] Start to read j2k main header (0). |
I found a problem which will cause memory is exhausted, and program hang for 8 minutes. My test server had 112GB of memory. This can cause denial of service.
Steps to Reproduce
POC.zip
opj_decompress -i POC -o /tmp/1.png
Analysis
System Configuration
These vulnerabilities have been found with a more efficient version of the AFL fuzzer.
The text was updated successfully, but these errors were encountered: