CarrierWave has a denylisted_content_type bypass via Unescaped Regex Metacharacters
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| carrierwaveuploader | carrierwave | before 2.2.7; 3.0.0.rc to before 3.1.3 | 2.2.7, 3.1.3 | Patch available | CNA |
| — | carrierwave (RubyGems) | 3.0.0.beta to before 3.1.3 | 3.1.3 | Patch available | GHSA-7g26-2qgj-chfg |
| — | carrierwave (RubyGems) | before 2.2.7 | 2.2.7 | Patch available | GHSA-7g26-2qgj-chfg |
- carrierwave Vendorcarrierwaveuploader Affected before 2.2.7; 3.0.0.rc to before 3.1.3 Fixed in 2.2.7, 3.1.3 Patch available CNA
- carrierwave (RubyGems) Vendor— Affected 3.0.0.beta to before 3.1.3 Fixed in 3.1.3 Patch available GHSA-7g26-2qgj-chfg
- carrierwave (RubyGems) Vendor— Affected before 2.2.7 Fixed in 2.2.7 Patch available GHSA-7g26-2qgj-chfg
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:* | before 2.2.7; 3.0.0 to before 3.1.3 | Vulnerable | carrierwaveuploader |
- cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:* Versions before 2.2.7; 3.0.0 to before 3.1.3 Vulnerable ·carrierwaveuploader
Remediation
- Fix · CNA carrierwave (carrierwaveuploader) Fixed in 2.2.7, 3.1.3
- Fix · GHSA-7g26-2qgj-chfg carrierwave (RubyGems) Fixed in 3.1.3 Advisory →
- Fix · GHSA-7g26-2qgj-chfg carrierwave (RubyGems) Fixed in 2.2.7 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-44587
- 2026-10-03 Alias added: GHSA-7g26-2qgj-chfg
References
Patch 2
More carrierwaveuploader Carrierwave vulnerabilities
- TI-2021-04405 Code Injection vulnerability in CarrierWave CVSS 3.1HIGH 8.8
- TI-2023-26755 CarrierWave has a content-type allowlist bypass vulnerability, possibly leading to XSS CVSS 3.1MEDIUM 6.8
- TI-2024-19216 CarrierWave's Content-Type allowlist bypass vulnerability which possibly leads to XSS remained CVSS 3.1MEDIUM 6.8
- TI-2021-04388 Server-side request forgery in CarrierWave CVSS 3.1MEDIUM 4.3
Sources
- CVE-2026-44587 · CVE Program
- CVE-2026-44587 · NVD
- FIRST EPSS
- GHSA-7g26-2qgj-chfg · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences