First published: Wed Nov 29 2023(Updated: )
### 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)
Credit: security-advisories@github.com
Affected Software | Affected Version | How to fix |
---|---|---|
rubygems/carrierwave | <2.2.5 | 2.2.5 |
rubygems/carrierwave | >=3.0.0<3.0.5 | 3.0.5 |
Carrierwave | <2.2.5 | |
Carrierwave | >=3.0.0<3.0.5 | |
debian/ruby-carrierwave | <=1.3.2-2 |
https://github.com/carrierwaveuploader/carrierwave/commit/39b282db5c1303899b3d3381ce8a837840f983b5
https://github.com/carrierwaveuploader/carrierwave/commit/863d425c76eba12c3294227b39018f6b2dccbbf3
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2023-49090 has a Content-Type allowlist bypass vulnerability, possibly leading to XSS.
CVE-2023-49090 has a severity score of 6.8 (medium).
CarrierWave versions up to 2.2.5 and versions between 3.0.0 and 3.0.5 are affected by CVE-2023-49090.
To fix CVE-2023-49090, you should update CarrierWave to version 2.2.6 or 3.0.6, which contain the necessary security fixes.
You can find more information about CVE-2023-49090 in the following references: [GitHub Security Advisory](https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-gxhx-g4fq-49hj), [Commit 39b282d](https://github.com/carrierwaveuploader/carrierwave/commit/39b282db5c1303899b3d3381ce8a837840f983b5), [Commit 863d425](https://github.com/carrierwaveuploader/carrierwave/commit/863d425c76eba12c3294227b39018f6b2dccbbf3).