Miggo Logo

CVE-2023-23627: Improper neutralization of `noscript` element content may allow XSS in Sanitize

6.1

CVSS Score
3.1

Basic Information

EPSS Score
0.52826%
Published
1/28/2023
Updated
2/13/2023
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
sanitizerubygems>= 5.0.0, < 6.0.16.0.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the fact that the CleanElement transformer (in clean_element.rb) did not account for the parsing discrepancy between Nokogiri (scripting-disabled mode) and browsers (scripting-enabled mode). The commit diff shows the addition of explicit noscript handling to forcibly remove these elements, indicating that the call method in this transformer was the point of failure. The tests added in test_clean_element.rb and test_malicious_html.rb confirm that allowing noscript in configs previously caused vulnerabilities, and the fix explicitly addresses this in the transformer.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t Usin* **r**ully *r**t** input, *n *tt**k*r m*y ** **l* to sn**k *r*itr*ry *TML t*rou** S*nitiz* `>= *.*.*, < *.*.*` w**n S*nitiz* is *on*i*ur** wit* * *ustom *llowlist t**t *llows `nos*ript` *l*m*nts. T*is *oul* r*sult in XSS (*ross-sit*

Reasoning

T** vuln*r**ility st*ms *rom t** ***t t**t t** `*l**n*l*m*nt` tr*ns*orm*r (in *l**n_*l*m*nt.r*) *i* not ***ount *or t** p*rsin* *is*r*p*n*y **tw**n Noko*iri (s*riptin*-*is**l** mo**) *n* *rows*rs (s*riptin*-*n**l** mo**). T** *ommit *i** s*ows t** **