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
Version: ImageMagick 7.0.6-5 Q16 x86_64 #./identify $FILE When identify PSD file , imagemagick will allocate memory to store the data, here is the critical code: psd.c , in function ReadPSDImage:
#./identify $FILE
if (ReadPSDLayersInternal(image,image_info,&psd_info,skip_layers, //2157 exception) != MagickTrue) { (void) CloseBlob(image); image=DestroyImageList(image); return((Image *) NULL); }
The critical function call chain is :ReadPSDLayersInternal->AcquireStringInfo->AcquireQuantumMemory,and in function AcquireStringInfo:
if (~string_info->length >= (MagickPathExtent-1)) string_info->datum=(unsigned char *) AcquireQuantumMemory( //182 string_info->length+MagickPathExtent,sizeof(*string_info->datum)); if (string_info->datum == (unsigned char *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); return(string_info);
The string_info->length 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_ReadPSDImage2157.psd Credit : ADLab of Venustech
The text was updated successfully, but these errors were encountered:
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.
Sorry, something went wrong.
https://github.com/ImageMagick/ImageMagick/issues/645
d5e0587
IM6 commit: 90ed668
Please use CVE-2017-13061 for this issue.
No branches or pull requests
Version: ImageMagick 7.0.6-5 Q16 x86_64
#./identify $FILEWhen identify PSD file , imagemagick will allocate memory to store the data, here is the critical code:
psd.c , in function ReadPSDImage:
The critical function call chain is :ReadPSDLayersInternal->AcquireStringInfo->AcquireQuantumMemory,and in function AcquireStringInfo:
The string_info->length can be controlled by input file,here is my policy.xml to limit memory usage,but 256MB limit can be bypassed.
testcase: https://github.com/bestshow/p0cs/blob/master/memory_exhaustion_in_ReadPSDImage2157.psd
Credit : ADLab of Venustech
The text was updated successfully, but these errors were encountered: