CVE-2024-29034: CarrierWave content-Type allowlist bypass vulnerability which possibly leads to XSS remained
6.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.07682%
CWE
Published
3/25/2024
Updated
3/27/2024
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
carrierwave | rubygems | >= 3.0.0, < 3.0.7 | 3.0.7 |
carrierwave | rubygems | < 2.2.6 | 2.2.6 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper Content-Type parsing in CarrierWave's sanitization logic. The commit diff shows critical changes to content type handling in sanitized_file.rb, replacing direct @file.content_type access with Marcel MIME type parsing. The vulnerable functions directly used the raw Content-Type header without properly extracting the primary MIME type, allowing attackers to bypass allowlists by providing multiple types (e.g., 'text/html, image/png'). Browser interpretation of the first valid MIME type while CarrierWave's validation saw the full string created the mismatch. The patch explicitly adds Marcel parsing and tests for multi-value scenarios, confirming these functions were the vulnerability source.