All reports
High

Sanitize vulnerable to Improper Input Validation and Cross-site Scripting

Affected versions

RubyGemssanitize
Affected versions
>= 3.0.0, < 4.6.3
Fixed version
4.6.3

Exploitation

CVE-2018-3740

Probability of exploitation in the next 30 days: 1.47%

FIRST EPSS · 2026-11-24

Description

When Sanitize <= 4.6.2 is used in combination with libxml2 >= 2.9.2, a specially crafted HTML fragment can cause libxml2 to generate improperly escaped output, allowing non-whitelisted attributes to be used on whitelisted elements.

This can allow HTML and JavaScript injection, which could result in XSS if Sanitize's output is served to browsers.

Links