CWE
79
Advisory Published
Advisory Published
Updated

CVE-2023-49090: CarrierWave has a content-type allowlist bypass vulnerability, possibly leading to XSS

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 SoftwareAffected VersionHow 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

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the impact of CVE-2023-49090?

    CVE-2023-49090 has a Content-Type allowlist bypass vulnerability, possibly leading to XSS.

  • What is the severity of CVE-2023-49090?

    CVE-2023-49090 has a severity score of 6.8 (medium).

  • Which software is affected by CVE-2023-49090?

    CarrierWave versions up to 2.2.5 and versions between 3.0.0 and 3.0.5 are affected by CVE-2023-49090.

  • How can I fix 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.

  • Where can I find more information about CVE-2023-49090?

    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).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203