Loading...
Skip to main content

CVE-2023-49090 — Vulnerability in carrierwave — CVE Details

MEDIUM

CarrierWave Content-Type allowlist bypass vulnerability, possibly leading to XSS

Published November 29, 2023Updated November 29, 2023Source: osv

Summary

### Impact [CarrierWave::Uploader::ContentTypeAllowlist](https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/uploader/content_type_allowlist.rb) has a Content-Type allowlist bypass vulnerability, possibly leading to XSS. The validation in `allowlisted_content_type?` determines Content-Type permissions by performing a partial match. If the `content_type` argument of `allowlisted_content_type?` is passed a value crafted by the attacker, Content-Types not included in the `content_type_allowlist` will be allowed. In addition, by setting the Content-Type configured by the attacker at the time of file delivery, it is possible to cause XSS on the user's browser when the uploaded file is opened. ### Patches Upgrade to [3.0.5](https://rubygems.org/gems/carrierwave/versions/3.0.5) or [2.2.5](https://rubygems.org/gems/carrierwave/versions/2.2.5). ### Workarounds When validating with `allowlisted_content_type?` in [CarrierWave::Uploader::ContentTypeAllowlist](https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/uploader/content_type_allowlist.rb) , forward match(`\A`) the Content-Type set in `content_type_allowlist`, preventing unintentional permission of `text/html;image/png` when you want to allow only `image/png` in `content_type_allowlist`. ### References [OWASP - File Upload Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html#content-type-validation)

Advisory Timeline

  • First published November 29, 2023 (1048 days ago).

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update carrierwave to 2.2.5 or later
gem install carrierwave -v 2.2.5
Bundler
Update carrierwave to 3.0.5 or later
gem install carrierwave -v 3.0.5

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
carrierwave
rubygems
0.1, 0.10.0, 0.11.0, 0.11.1 (+65 more)2.2.5
carrierwave
rubygems
3.0.0, 3.0.1, 3.0.2, 3.0.3 (+1 more)3.0.5

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N

Frequently Asked Questions

What is CVE-2023-49090?
CarrierWave Content-Type allowlist bypass vulnerability, possibly leading to XSS This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.8/10).
How do I check if my project is affected by CVE-2023-49090?
CVE-2023-49090 affects carrierwave. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2023-49090 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.8

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-gxhx-g4fq-49hj

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies