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

Implement PNG enginge #6

Closed
odan opened this issue Jul 28, 2019 · 0 comments
Closed

Implement PNG enginge #6

odan opened this issue Jul 28, 2019 · 0 comments

Comments

@odan
Copy link
Member

odan commented Jul 28, 2019

PNG Bomb Protection

  • if you found super large (400 GB) file in your tmp directory (/tmp) with the name like "magick-*"
  • or if see lack of the memory on the server for uploaded images
  • or if see lack of disk space on the server for uploaded images
  • or if there are some unexplained problems with uploading of images

It seems that someone uploaded to your server PNG bomb (a unicolor picture in PNG format with a very big width and height).

The solution: check image width and height before image processing.

For this you could use image magick tool. Here is an example for PHP:

if ($width > 10000 || $height > 10000) {
    // invalid image
}

More information you could find here:

odan added a commit that referenced this issue Aug 1, 2019
odan added a commit that referenced this issue Aug 1, 2019
odan added a commit that referenced this issue Aug 1, 2019
odan added a commit that referenced this issue Aug 1, 2019
@odan odan closed this as completed Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant