image_processing
image_processing copied to clipboard
Block unfuzzed loaders with libvips 8.13+
There is a new libvips 8.13+ to block unfuzzed loaders using vips-block-untrusted-set.
I think this should be enabled by default to improve security, as most of the time the images processed by image_processing come from an user-controlled source.
Thanks for the heads up. Any idea how to call it via ruby-vips? I'm guessing that's something that should be called globally at require time, rather than per image.
Yes, this should be a global call.
As far as I can see, there is no support for this in ruby-vips yet. We could set the VIPS_BLOCK_UNTRUSTED env variable, but this does not require a change in image_processing and users can do it themselves.
I am not sure of the proper way to handle this in image_processing and if this gem needs to use more granular blocking
Heroku have libvips in their stack images!
https://devcenter.heroku.com/changelog-items/2549
But they include a lot of insecure load libraries :( Anyone using image_processing on heroku will (probably) be trivially vulnerable to remote code execution attacks, or at the very least denial of service attacks.
How about setting the VIPS_BLOCK_UNTRUSTED env var on by default? It would fix this potential issue, for recent libvips at least.
edit sigh, the libvips that supports blocking is in ubuntu from 22.10, so won't be in heroku for ages. Blocking would still help people who have built their own libvips.
The libvips versions in heroku stack images are old. It is better to continue using custom buildpacks.
@jcupitt I maintain a custom buildpack here that has the latest libvips version (currently 8.14.1). I have read your suggestions on other buildpacks and used your docker files as reference. Any suggestions that can increase security and make the buildpack better are highly appreciated.
Oh, nice @jonian! I'll open an issue with come comments.