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

Source: https://junglewise.ai/threats/cve-2026-44587-carrierwave-bypass-in-content-type-denylist-regex-validation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-17. Updated: 2026-06-20  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/carrierwave). Vendors: [RubyGems](https://junglewise.ai/threats/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

  ```sh
  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

- [https://github.com/carrierwaveuploader/carrierwave/commit/21221cc6e260633f7da78c6133a88666a5529d27](https://github.com/carrierwaveuploader/carrierwave/commit/21221cc6e260633f7da78c6133a88666a5529d27)
- [https://github.com/carrierwaveuploader/carrierwave/commit/4c4a005775a436c5165df014dc9b1874c227d86c](https://github.com/carrierwaveuploader/carrierwave/commit/4c4a005775a436c5165df014dc9b1874c227d86c)
- [https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-7g26-2qgj-chfg](https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-7g26-2qgj-chfg)

## Related threats

- [CarrierWave content-Type allowlist bypass vulnerability which possibly leads to XSS remained](https://junglewise.ai/threats/cve-2024-29034-carrierwave-content-type-allowlist-bypass-vulnerability-which)
- [CarrierWave Content-Type allowlist bypass vulnerability, possibly leading to XSS](https://junglewise.ai/threats/cve-2023-49090-carrierwave-content-type-allowlist-bypass-vulnerability-possibly)
- [Code Injection vulnerability in CarrierWave::RMagick](https://junglewise.ai/threats/cve-2021-21305-code-injection-vulnerability-in-carrierwave-rmagick)
- [Server-side request forgery in CarrierWave](https://junglewise.ai/threats/cve-2021-21288-server-side-request-forgery-in-carrierwave)
