Skip to content

Commit

Permalink
Merge pull request #738 from hugovk/warning
Browse files Browse the repository at this point in the history
Warn about decompression bombs
  • Loading branch information
hugovk committed Jun 27, 2014
2 parents 3f5b15f + c927ab2 commit be61256
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/reference/Image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Functions

.. autofunction:: open

.. warning:: > To protect against potential DOS attacks caused by "[decompression bombs](https://en.wikipedia.org/wiki/Zip_bomb)" (i.e. malicious files which decompress into a huge amount of data and are designed to crash or cause disruption by using up a lot of memory), Pillow will issue a `DecompressionBombWarning` if the image is over a certain limit. If desired, the warning can be turned into an error with `warnings.simplefilter('error', Image.DecompressionBombWarning)` or suppressed entirely with `warnings.simplefilter('ignore', Image.DecompressionBombWarning)`. See also [the logging documentation](https://docs.python.org/2/library/logging.html?highlight=logging#integration-with-the-warnings-module) to have warnings output to the logging facility instead of stderr.

Image processing
^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit be61256

Please sign in to comment.