CVE-2023-23627: Improper neutralization of `noscript` element content may allow XSS in Sanitize
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.52826%
CWE
Published
1/28/2023
Updated
2/13/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| sanitize | rubygems | >= 5.0.0, < 6.0.1 | 6.0.1 |
Vulnerability Intelligence
Miggo AI
Root 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.