{"id":"CVE-2023-49090","aliases":["CVE-2023-49090","GHSA-gxhx-g4fq-49hj"],"related":[],"kind":"vulnerability","state":"published","title":"CarrierWave has a content-type allowlist bypass vulnerability, possibly leading to XSS","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n[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. \n\nThe validation in `allowlisted_content_type?` determines Content-Type permissions by performing a partial match.\nIf 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.\n\nIn 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.\n\n### Patches\nUpgrade 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).\n\n### Workarounds\nWhen 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`.\n\n### References\n[OWASP - File Upload Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html#content-type-validation)","format":"markdown","source":"ghsa"},{"lang":"es","text":"CarrierWave es una solución para carga de archivos para Rails, Sinatra y otros frameworks web Ruby. CarrierWave tiene una vulnerabilidad de omisión de lista permitida de tipo de contenido, que posiblemente conduzca a XSS. La validación en `allowlisted_content_type?` determina los permisos de tipo de contenido realizando una coincidencia parcial. Si al argumento `content_type` de `allowlisted_content_type?` se le pasa un valor creado por el atacante, se permitirán los tipos de contenido no incluidos en `content_type_allowlist`. Este problema se solucionó en las versiones 2.2.5 y 3.0.5.","source":"nvd"}],"published":"2023-11-29T14:38:52.195Z","modified":"2026-06-17T06:35:20.703Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 2.2.0, < 2.2.5","status":"affected"},{"version":">= 3.0.0, < 3.0.5","status":"affected"}],"vendor":"carrierwaveuploader","product":"carrierwave","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0","status":"affected","fixed":"3.0.5"}],"ecosystem":"RubyGems","package":"carrierwave","purl":"pkg:gem/carrierwave","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.5"}],"ecosystem":"RubyGems","package":"carrierwave","purl":"pkg:gem/carrierwave","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.2.5"},{"status":"affected","introduced":"3.0.0","fixed":"3.0.5"}],"vendor":"carrierwave_project","product":"carrierwave","cpe":"cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-gxhx-g4fq-49hj","tags":["vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/commit/39b282db5c1303899b3d3381ce8a837840f983b5","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/commit/863d425c76eba12c3294227b39018f6b2dccbbf3","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-49090","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/carrierwaveuploader/carrierwave","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/uploader/content_type_allowlist.rb","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/carrierwave/CVE-2023-49090.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://rubygems.org/gems/carrierwave/versions/2.2.5","tags":["web"],"sources":["ghsa"]},{"url":"https://rubygems.org/gems/carrierwave/versions/3.0.5","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-10-11T17:51:30.827Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-49090","url":"https://www.cve.org/CVERecord?id=CVE-2023-49090","licence":"CVE Terms of Use","modified":"2024-10-11T17:55:40.314Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gxhx-g4fq-49hj","url":"https://github.com/advisories/GHSA-gxhx-g4fq-49hj","licence":"CC-BY-4.0","modified":"2023-11-29T21:33:27.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-49090","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-49090","licence":"Public domain","modified":"2026-06-17T06:35:20.703Z"}],"updatedAt":"2026-11-25T22:58:30.784Z","epss":{"score":0.00757,"percentile":0.51475,"date":"2026-11-30T12:00:22.000Z"}}