CVE-2018-16468: Loofah Cross-site Scripting vulnerability
5.4
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.54024%
CWE
Published
11/1/2018
Updated
1/23/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
loofah | rubygems | < 2.2.3 | 2.2.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper sanitization of SVG attributes during HTML processing. Loofah's SafeList configuration (ALLOWED_ATTRIBUTES) and attribute application logic (apply_attributes) are central to XSS protection. The advisory specifically mentions SVG-related XSS, indicating the scrubber failed to remove JavaScript-executing attributes from SVG elements. The SafeList's attribute allowlist for SVG elements likely contained gaps (e.g., permitting 'on*' event handlers or unsafe 'href' values), while the attribute application logic failed to properly validate these attributes against the allowlist. These components directly align with the described vulnerability pattern of allowing unsanitized JavaScript in sanitized output.