p PatchFirst

CVE-2026-44587

CVE-2026-44587 · CarrierWave has a denylisted_content_type bypass via Unescaped Regex Metacharacters

CVSS 4.7 · Medium · EPSS 0.2% · Fix available

Compare with your installed version

Affected products and known fixed versions are public information. Compare them with your installed version.

Check the installed version:

dpkg-query -W -f='${source:Package} ${binary:Package} ${Version}\n' | awk '$1=="ruby-carrierwave"'
gem list --exact carrierwave

Assess your server’s risks

The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.

Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.

curl -fsSL https://patchfirst.dev/check.sh | sh
Check your server for free →

Channels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.

This page contains facts from public vulnerability sources. Check the original advisory before updating.

CarrierWave is a framework to upload files from Ruby applications. In versions prior to 2.2.7 and 3.1.3, the content_type_denylist check fails to escape regex metacharacters in string entries, causing the denylist to silently not match the content types it is intended to block. In lib/carrierwave/uploader/content_type_denylist.rb:57, denylist entries are interpolated directly into a regex without Regexp.quote or anchoring, so an entry such as image/svg+xml becomes the pattern /image\/svg+xml/, in which + is treated as a quantifier rather than a literal character and therefore never matches the real MIME type image/svg+xml. This is inconsistent with the allowlist implementation, which correctly applies both Regexp.quote and a \A anchor. Other content types containing regex metacharacters, such as application/xhtml+xml, are affected as well. As a result, any application that relies on content_type_denylist to block image/svg+xml, most commonly to prevent stored XSS, is silently unprotected. An attacker can upload an SVG file containing arbitrary JavaScript; if the application serves that SVG inline from its own origin, the script executes in the victim's browser, resulting in stored XSS. This issue has been fixed in versions 2.2.7 and 3.1.3.

Published
Updated

Stack: system · ruby

Affected products and versions

  • carrierwave

    Versions
    • < 2.2.7: Affected
    • >= 3.0.0.rc, < 3.1.3: Affected

    No fix published

  • ruby-carrierwave Debian 12

    Versions
    • 1.3.2-2
    • 2.0.2-1
    • 2.2.2-1
    • 3.0.7-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • carrierwave RubyGems

    Versions
    • 3.0.0
    • 3.0.0.beta
    • 3.0.0.rc
    • 3.0.1
    • 3.0.2
    • 3.0.3
    All versions (15)
    • 3.0.4
    • 3.0.5
    • 3.0.6
    • 3.0.7
    • 3.1.0
    • 3.1.0.beta
    • 3.1.0.rc
    • 3.1.1
    • 3.1.2
    Affected ranges
    • ECOSYSTEM: ≥ 3.0.0.beta, < 3.1.3

    Update to 3.1.3

  • carrierwave RubyGems

    Versions
    • 0.1
    • 0.10.0
    • 0.11.0
    • 0.11.1
    • 0.11.2
    • 0.2.0
    All versions (71)
    • 0.2.1
    • 0.2.3
    • 0.2.4
    • 0.3.0
    • 0.3.1
    • 0.3.2
    • 0.3.3
    • 0.3.4
    • 0.3.5
    • 0.3.5.1
    • 0.3.5.2
    • 0.4.0
    • 0.4.1
    • 0.4.10
    • 0.4.2
    • 0.4.3
    • 0.4.4
    • 0.4.5
    • 0.4.6
    • 0.4.7
    • 0.4.8
    • 0.4.9
    • 0.5.0
    • 0.5.0.beta2
    • 0.5.1
    • 0.5.2
    • 0.5.3
    • 0.5.4
    • 0.5.5
    • 0.5.6
    • 0.5.7
    • 0.5.8
    • 0.6.0
    • 0.6.1
    • 0.6.2
    • 0.7.0
    • 0.7.1
    • 0.8.0
    • 0.9.0
    • 1.0.0
    • 1.0.0.beta
    • 1.0.0.rc
    • 1.1.0
    • 1.2.0
    • 1.2.1
    • 1.2.2
    • 1.2.3
    • 1.3.0
    • 1.3.1
    • 1.3.2
    • 1.3.3
    • 1.3.4
    • 2.0.0
    • 2.0.0.rc
    • 2.0.1
    • 2.0.2
    • 2.1.0
    • 2.1.1
    • 2.2.0
    • 2.2.1
    • 2.2.2
    • 2.2.3
    • 2.2.4
    • 2.2.5
    • 2.2.6
    Affected ranges
    • ECOSYSTEM: < 2.2.7

    Update to 2.2.7

  • ruby-carrierwave Ubuntu 16.04 LTS

    Versions
    • 0.10.0+gh-1
    • 0.10.0+gh-2
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • ruby-carrierwave Ubuntu Pro 18.04 LTS

    Versions
    • 0.10.0+gh-4
    • 1.1.0-3
    • 1.2.2-1
    • 1.2.2-1ubuntu0.1~esm1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • ruby-carrierwave Ubuntu Pro 20.04 LTS

    Versions
    • 1.3.1-2
    • 1.3.1-2ubuntu0.1~esm1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • ruby-carrierwave Ubuntu Pro 22.04 LTS

    Versions
    • 1.3.2-2
    • 1.3.2-2ubuntu0.22.04.1~esm1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • ruby-carrierwave Ubuntu Pro 24.04 LTS

    Versions
    • 1.3.2-2
    • 1.3.2-2ubuntu0.24.04.1~esm1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →