{"id":"CVE-2026-44587","published":"2026-06-16T23:10:43Z","modified":"2026-06-17T18:12:37Z","title":"CarrierWave has a denylisted_content_type bypass via Unescaped Regex Metacharacters","vendor":"carrierwaveuploader","product":"carrierwave","tier":"tail","description":{"text":"CarrierWave is a framework to upload files from Ruby applications. In versions prior to 2.2.7 and 3.1.3, the content_type_denylist check fails to escape regex metacharacters in string entries, causing the denylist to silently not match the content types it is intended to block. In lib/carrierwave/uploader/content_type_denylist.rb:57, denylist entries are interpolated directly into a regex without Regexp.quote or anchoring, so an entry such as image/svg+xml becomes the pattern /image\\/svg+xml/, in which + is treated as a quantifier rather than a literal character and therefore never matches the real MIME type image/svg+xml. This is inconsistent with the allowlist implementation, which correctly applies both Regexp.quote and a \\A anchor. Other content types containing regex metacharacters, such as application/xhtml+xml, are affected as well. As a result, any application that relies on content_type_denylist to block image/svg+xml, most commonly to prevent stored XSS, is silently unprotected. An attacker can upload an SVG file containing arbitrary JavaScript; if the application serves that SVG inline from its own origin, the script executes in the victim's browser, resulting in stored XSS. This issue has been fixed in versions 2.2.7 and 3.1.3.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.7,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00223,"percentile":0.13237,"provenance":"source"},"cwes":[{"id":"CWE-625","name":"Permissive Regular Expression"},{"id":"CWE-184","name":"Incomplete List of Disallowed Inputs"},{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-7g26-2qgj-chfg","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/commit/21221cc6e260633f7da78c6133a88666a5529d27","tags":["x_refsource_MISC"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/commit/4c4a005775a436c5165df014dc9b1874c227d86c","tags":["x_refsource_MISC"]}],"priority":{"score":5.9,"factors":[{"name":"EPSS percentile","points":2.65},{"name":"CVSS severity","points":3.29}]},"vendorSlug":"carrierwaveuploader","affectedVersions":[{"vendor":"carrierwaveuploader","product":"carrierwave","versions":["< 2.2.7",">= 3.0.0.rc, < 3.1.3"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-06-17T18:06:48.640514Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"carrierwave","vulnerableRanges":[">=3.0.0.beta, <3.1.3","<2.2.7"],"patched":["3.1.3","2.2.7"],"from":["GHSA-7g26-2qgj-chfg"],"provenance":"source"}],"summary":{"text":"The CarrierWave Ruby file upload framework's content_type_denylist check fails to escape regex metacharacters in denylist entries, so entries such as image/svg+xml are never matched and the intended blocking silently does not occur. An attacker can upload a file containing arbitrary JavaScript, such as an SVG, which causes stored cross-site scripting if the application serves it inline from its own origin, and this requires that the attacker can reach the upload function and that a victim then views the file in their browser.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:19:00Z"},"euvd":{"id":"EUVD-2026-37515","exploited":false,"provenance":"source"}}