Skip to content

Block libvips untrusted operations for image uploads - #141

Draft
parterburn wants to merge 1 commit into
mainfrom
paul-cursor/block-libvips-untrusted-0317
Draft

Block libvips untrusted operations for image uploads#141
parterburn wants to merge 1 commit into
mainfrom
paul-cursor/block-libvips-untrusted-0317

Conversation

@parterburn

@parterburn parterburn commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

Defense-in-depth for Dabble Me’s libvips image pipeline (CarrierWave::Vips, collages, MCP/ImageProcessing::Vips).

CVE-2026-66066 targets Active Storage variant processing. Dabble Me does not use Active Storage for uploads, so that advisory’s Rails bump does not apply. We still process untrusted user images with the same underlying libvips surface, and nothing was calling Vips.block_untrusted(true).

Changes

  • Add config/initializers/vips.rb to disable unfuzzed/untrusted libvips loaders and savers at boot (web + Sidekiq).
  • Fail boot if libvips/ruby-vips are too old to honor the flag (libvips ≥ 8.13, ruby-vips ≥ 2.2.1).
  • Spec covers trusted formats still loading and SVG (untrusted) being rejected.

Expected impact

  • Still works: JPEG, PNG, GIF, WebP, HEIC/HEIF
  • Blocked: Magick-delegated / exotic formats (SVG, PDF, JPEG 2000, JXL, BMP/ICO/PSD via Magick, etc.) that Dabble Me does not support anyway

Test plan

  • bundle exec rspec spec/initializers/vips_spec.rb (+ collage/uploader specs) — 11 examples, 0 failures
  • Spot-check HEIC/JPEG upload + collage path still processes in staging/prod after deploy
  • Confirm production libvips is ≥ 8.13 (required for the block API)
Open in Web Open in Cursor 

Dabble Me feeds untrusted photos through CarrierWave::Vips and collage
generation. Disable libvips unfuzzed operations at boot so Magick/SVG/PDF
and similar loaders cannot run, while keeping JPEG/PNG/GIF/WebP/HEIC.

Co-authored-by: Paul Arterburn <parterburn@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants