Skip to content
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 exhaustion in ReadTIFFImage #736

Closed
bestshow opened this issue Sep 7, 2017 · 3 comments
Closed

memory exhaustion in ReadTIFFImage #736

bestshow opened this issue Sep 7, 2017 · 3 comments
Labels

Comments

@bestshow
Copy link

bestshow commented Sep 7, 2017

Version: ImageMagick 7.0.7-1 Q16 x86_64
#./convert $FILE /dev/null
When convert tiff file , imagemagick will allocate memory to store the data, here is the critical code:
(tiff.c , in function ReadTIFFImage)

        tile_pixels=(uint32 *) AcquireQuantumMemory(columns,rows*  //1934
          sizeof(*tile_pixels));

The "rows" can be got from tiff file,that is to say it can be controlled by input file.Here is my policy.xml to limit memory usage,but 256MB limit can be bypassed.

...
<policy domain="resource" name="area" value="100MP"/>
<policy domain="resource" name="memory" value="256MiB"/>
...

testcase:https://github.com/bestshow/p0cs/blob/master/memory_exhaustion_in_ReadTIFFImage_1934
Credit:ADLab of Venustech

@asarubbo
Copy link

asarubbo commented Sep 7, 2017

see #269

@mikayla-grace
Copy link

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

@nohmask
Copy link

nohmask commented Jan 15, 2018

This was assigned CVE-2017-18028.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

5 participants