Skip to content

Upgrade image_processing to 2.0.3 with explicit mini_magick backend - #2843

Merged
olleolleolle merged 1 commit into
masterfrom
fix/image-processing-2-backends
Sep 3, 2026
Merged

Upgrade image_processing to 2.0.3 with explicit mini_magick backend#2843
olleolleolle merged 1 commit into
masterfrom
fix/image-processing-2-backends

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

Upgrading image_processing to 2.0.3 breaks this app on its own: 2.0 made the mini_magick and ruby-vips backends soft dependencies, so dependabot's re-resolution (#2840) dropped both from the lockfile, Active Storage's boot path failed without ruby-vips, and the first avatar or image upload would fail without mini_magick. This PR takes the upgrade with the two changes image_processing 2.0's migration requires, scoped so the vips backend and its native libvips system dependency are never needed.

Key changes:

  • gem "mini_magick" added as a direct dependency — CarrierWave::MiniMagick (avatar_uploader.rb, image_uploader.rb) processes every avatar and event image upload through it. Depending on it transitively is what let the lockfile drop it.
  • config.active_storage.variant_processor = :mini_magick in config/application.rb — Active Storage variants are unused by this app, so the transformer keeps the same backend CarrierWave already uses and the vips backend (which needs a native libvips install in CI and production) is never loaded.
  • ruby-vips is therefore not needed anywhere and stays out of the lockfile.
Why this upgrade is worth taking

image_processing 2.0.1-2.0.3 fix several remote-code-execution paths (shell execution through loader/saver options, operation names from user input). The app never calls ImageProcessing directly and uses no Active Storage variants, so the vulnerable surface is not reachable today; the upgrade keeps the gem current and closes those paths if variant processing is ever adopted. Replacing dependabot PR #2840, whose lockfile dropped the backends and failed to boot.

image_processing 2.0 made mini_magick and ruby-vips soft dependencies.
Depending on them transitively (as 1.x did) meant the dependabot bump
dropped both from the lockfile, which broke boot (ruby-vips) and would
break avatar/image uploads (mini_magick).

Add mini_magick as a direct dependency for the CarrierWave::MiniMagick
uploaders, and pin Active Storage's variant processor to :mini_magick so
the vips backend and its native libvips dependency are never loaded.
Active Storage variants are unused by this app. ruby-vips is therefore
not needed anywhere.
@mroderick
mroderick marked this pull request as ready for review September 3, 2026 13:43

@olleolleolle olleolleolle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clear, thanks!

@olleolleolle
olleolleolle merged commit 9dbd87d into master Sep 3, 2026
10 checks passed
@olleolleolle
olleolleolle deleted the fix/image-processing-2-backends branch September 3, 2026 13:53
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