Miggo Logo

CVE-2018-16468: Loofah Cross-site Scripting vulnerability

5.4

CVSS Score
3.0

Basic Information

EPSS Score
0.54024%
Published
11/1/2018
Updated
1/23/2023
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
loofahrubygems< 2.2.32.2.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

In t** Loo*** **m *or Ru*y, t*rou** v*rsion *.*.*, uns*nitiz** J*v*S*ript m*y o**ur in s*nitiz** output w**n * *r**t** SV* *l*m*nt is r*pu*lis***. Us*rs *r* **vis** to up*r*** to v*rsion *.*.*. S** *ttps://*it*u*.*om/*l*vorjon*s/loo***/issu*s/*** *o

Reasoning

T** vuln*r**ility st*ms *rom improp*r s*nitiz*tion o* SV* *ttri*ut*s *urin* *TML pro**ssin*. Loo***'s S***List *on*i*ur*tion (*LLOW**_*TTRI*UT*S) *n* *ttri*ut* *ppli**tion lo*i* (*pply_*ttri*ut*s) *r* **ntr*l to XSS prot**tion. T** **visory sp**i*i**