Skip to content
Fencer Intel
high 7.5

CVE-2018-3740 json

Sanitize vulnerable to Improper Input Validation and Cross-site Scripting

published 2018-03-21 8 y ago modified 2026-06-17 4 mo ago also GHSA-7f42-p84j-f58p , EUVD-2018-0174

cvss
7.5
version 3.0, NVD
cisa kev
Not listed
not in CISA's catalog
epss
1.5%
EPSS 1.5% chance of exploitation in 30 days, percentile 73%
public exploits
0
none known

Summary

A specially crafted HTML fragment can cause Sanitize gem for Ruby to allow non-whitelisted attributes to be used on a whitelisted HTML element.

Patch / fix

  • rubygems sanitize 4.6.3
  • ruby-sanitize Debian 14, Debian 13, Debian 12 4.6.6-1

debian advisories DEBIAN-CVE-2018-3740

  • ruby-sanitize Ubuntu 16.04 LTS 2.1.0-2+deb9u1build0.16.04.1
  • ruby-sanitize Ubuntu 18.04 LTS 2.1.0-2+deb9u1build0.18.04.1

ubuntu advisories UBUNTU-CVE-2018-3740

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • gitlab Arch Linux 11.0.1-1

arch linux advisories AVG-726

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2018-3740 updated cvss 7.1

rubygem-sanitize: Improper filtering by libxml2 allows for cross-site scripting (XSS)

  • Red Hat All currently supported Red Hat products
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

1.47% chance of exploitation in the next 30 days, higher than 73% of all scored CVEs (FIRST EPSS, 2026-11-09).

CVSS scores

assigned by version score vector
NVD 3.0 7.5 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD 2.0 5.0 AV:N/AC:L/Au:N/C:N/I:P/A:N
GitHub 3.0 7.5 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Affected packages

ecosystem package affected fixed in
rubygems sanitize
>=3.0.0, <4.6.3
4.6.3

Affected products

  • Ryan Grove sanitize (ruby gem)

Classification

Weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation
  • CWE-20 Improper Input Validation

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.