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

use after free in ReadWMFImage #555

Closed
bestshow opened this issue Jul 9, 2017 · 5 comments
Closed

use after free in ReadWMFImage #555

bestshow opened this issue Jul 9, 2017 · 5 comments
Labels

Comments

@bestshow
Copy link

bestshow commented Jul 9, 2017

Version: ImageMagick 7.0.6-1 Q16 x86_64

#./magick identify $FILE

When identify WMF file , a crafted file revealed a use-after-free vulnerability.
A piece of memory was allocated in in function wmf_malloc.(api.c)
mem = malloc (size); //482

Free:(api.c, in function wmf_lite_destory )
free (MM->list[MM->count]); //336

Use after free: (wmf.c, in function ReadWMFImage)
if (ddata->draw_info != (DrawInfo *) NULL) //2682
testcase: https://github.com/bestshow/p0cs/blob/master/use-after-free-in-ReadWMFImage
Credit: ADLab of Venustech

@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.

@bastien-roucaries
Copy link

Sorry this is not incomplete... deleted my post

@bastien-roucaries
Copy link

@msmeissn
Copy link

Was this not just introduced 3 days before by commit b2b48d5 ?

@nohmask
Copy link

nohmask commented Sep 8, 2017

This was assigned CVE-2017-12431.

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

6 participants