# CarrierWave BombShelter

> A Ruby gem designed to detect an image’s real dimensions without decoding it.

- URL: https://evilmartians.com/opensource/carrierwave-bombshelter
- GitHub: https://github.com/DarthSim/carrierwave-bombshelter
- Authors: Sergey Alexandrovich

---

carrierwave-bombshelter is a Ruby gem designed to detect an image’s real dimensions without decoding it. bombshelter saves memory and disk space, letting engineers adjust image sizes according to their application’s facilities.

BombShelter is a module that protects your uploaders from image bombs like https://www.bamsoftware.com/hacks/deflate.html and http://www.openwall.com/lists/oss-security/2016/05/03/18. It checks the type and pixel dimensions of an uploaded image before ImageMagick touches it.

BombShelter uses the `fastimage` gem, which reads just a header of an image to get info about it. BombShelter compares the type and pixel dimensions of the uploaded image with the allowed ones and raises integrity error if an image is too big or has an unsupported type. Works perfectly with ActiveRecord validators.
