CVE-2026-44587: CarrierWave bypass in content_type_denylist regex validation

CVE-2026-44587 · Severity: medium · CVSS 4.7 · Published 2026-06-17

CarrierWave, a popular file upload framework for Ruby applications, contains a flaw in its file-type blocking mechanism. This vulnerability allows attackers to bypass security filters and upload restricted file types, such as SVG images containing malicious scripts. If these files are then viewed by other users, it can lead to unauthorized actions or data theft through Cross-Site Scripting (XSS).

Technologies: carrierwave (RubyGems). Vendors: RubyGems.

Quick answers

Is CVE-2026-44587 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-44587 being exploited in the wild.
How severe is CVE-2026-44587?
Medium severity, with a CVSS score of 4.7, published 17 June 2026.
Which products and versions are affected?
carrierwave (RubyGems) ECOSYSTEM:introduced=3.0.0.beta,fixed=3.1.3.
Is there a fix for CVE-2026-44587?
Yes. carrierwave (RubyGems): upgrade to 3.1.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-44587 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-44587?
Check whether you run carrierwave (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • carrierwave (RubyGems): upgrade to 3.1.3 or later
    bundle update carrierwave

Technical details

A vulnerability exists in CarrierWave's `content_type_denylist` (and the deprecated `content_type_blacklist`) where string entries are interpolated directly into a regular expression without escaping or anchoring. Specifically, in `lib/carrierwave/uploader/content_type_denylist.rb`, the code uses `content_type =~ /#{item}/`. For MIME types containing regex metacharacters like 'image/svg+xml', the '+' is interpreted as a quantifier rather than a literal character, causing the match to fail. An attacker can exploit this by uploading a malicious SVG file that bypasses the denylist. If the application serves the SVG inline, it results in stored Cross-Site Scripting (XSS). The issue is fixed in versions 2.2.7 and 3.1.3 by implementing `Regexp.quote` and `\A` anchoring.

Affected products

  • carrierwaveuploader CarrierWave < 2.2.7, >= 3.0.0.rc < 3.1.3

Identifiers

  • CVE-2026-44587
  • GHSA-7g26-2qgj-chfg

Timeline

  • 2026-05-23: advisory: GitHub Security Advisory published
  • 2026-06-17: disclosed: CVE-2026-44587 published to NVD
  • 2026-06-17: patched: Fixes released in versions 2.2.7 and 3.1.3

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.