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

Missing checks in various coders. #1295

Closed
3 tasks done
tianxiaogu opened this issue Sep 5, 2018 · 2 comments
Closed
3 tasks done

Missing checks in various coders. #1295

tianxiaogu opened this issue Sep 5, 2018 · 2 comments

Comments

@tianxiaogu
Copy link

tianxiaogu commented Sep 5, 2018

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of ImageMagick
  • I have searched open and closed issues to ensure it has not already been reported

Description

Based on the patch of ImageMagick/ImageMagick6@d5e7c2b, we found that many ReadXXXImage functions in coders/XXX.c miss the similar check against GetBlobSize(image). Hope this issue is helpful.

Known examples:

  • dib
  • pcx
  • sgi
  • pnm

Steps to Reproduce

A set of artifacts would be helpful. HANGS.zip

System Configuration

  • ImageMagick version: HEAD
  • Environment (Operating system, version and so on): Ubuntu 18.04 x86-64, clang-8
  • Additional information:
@tianxiaogu tianxiaogu changed the title Missing checks in ReadPNMImage in pnm.c Missing checks in various coders. Sep 5, 2018
@urban-warrior
Copy link
Member

ImageMagick best practices strongly encourages you to configure a security policy that suits your local environment. Add these policies to your policy.xml configuration file:

  <policy domain="resource" name="width" value="10KP"/>
  <policy domain="resource" name="height" value="10KP"/>

With these policies, all your artifacts complete in a reasonable time with this exception:

convert: width or height exceeds limit id:000065,src:003779+007146,op:splice,rep:64' @ error/cache.c/OpenPixelCache/3699.`

In the mean-time, we will add additional checks for certain coders against the image file size as you suggest.

urban-warrior pushed a commit to ImageMagick/ImageMagick6 that referenced this issue Sep 8, 2018
@urban-warrior
Copy link
Member

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 @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

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

No branches or pull requests

2 participants