Miggo Logo

CVE-2023-49090: CarrierWave Content-Type allowlist bypass vulnerability, possibly leading to XSS

6.8

CVSS Score
3.1

Basic Information

EPSS Score
0.34822%
Published
11/29/2023
Updated
11/30/2023
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
carrierwaverubygems>= 3.0.0, < 3.0.53.0.5
carrierwaverubygems< 2.2.52.2.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The core vulnerability stems from the regex implementation in content type validation functions. The commit diff shows the critical fix was adding \A regex anchors to enforce start-of-string matching in both allowlist/whitelist variants. The vulnerability description explicitly calls out partial matching in allowlisted_content_type? as the root cause, and the added test cases demonstrate crafted Content-Type bypass scenarios that this function's flawed implementation allowed.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t [**rri*rW*v*::Uplo***r::*ont*ntTyp**llowlist](*ttps://*it*u*.*om/**rri*rw*v*uplo***r/**rri*rw*v*/*lo*/m*st*r/li*/**rri*rw*v*/uplo***r/*ont*nt_typ*_*llowlist.r*) **s * *ont*nt-Typ* *llowlist *yp*ss vuln*r**ility, possi*ly l***in* to XSS.

Reasoning

T** *or* vuln*r**ility st*ms *rom t** r***x impl*m*nt*tion in *ont*nt typ* v*li**tion *un*tions. T** *ommit *i** s*ows t** *riti**l *ix w*s ***in* \* r***x *n**ors to *n*or** st*rt-o*-strin* m*t**in* in *ot* *llowlist/w*it*list v*ri*nts. T** vuln*r**