CVE-2018-3741Rubyonrails Html Sanitizer
Medium 6.1 No auth needed
Follow: this CVE · Rubyonrails · Rubyonrails Html Sanitizer We alert you by email or Slack (account required).
- Priority
- 52
- CVSS 3.1
- 6.1
- EPSS
- 1.3% probability of exploitation in 30 days · percentile 69
- Auth required
- No
- Published
- Mar 30, 2018
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-79
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
What happens
There is a possible XSS vulnerability in all rails-html-sanitizer gem versions below 1.0.4 for Ruby. The gem allows non-whitelisted attributes to be present in sanitized output when input with specially-crafted HTML fragments, and these attributes can lead to an XSS attack on target applications. This issue is similar to CVE-2018-8048 in Loofah. All users running an affected release should either upgrade or use one of the workarounds immediately.
What to do
- Apply the vendor's security update for Html Sanitizer.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| RubyGems | rails-html-sanitizer |
< 1.0.4 |
1.0.4 |
gem "rails-html-sanitizer", ">= 1.0.4" |
Per OSV / GitHub Advisories (GHSA-px3r-jm9g-c8w8). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| rubyonrails | html_sanitizer | ≤ 1.0.3 |
Official advisories
- ruby4.0-rubygem-rails-html-sanitizer-1.6.0-1.9 on GA media · SUSE · openSUSE-SU-2026:10361-1 · Mar 13, 2026 High
Vendor, CERT and distribution advisories that name this CVE. Original titles.
Official sources
References
Links published by the sources. Open them with care.
- github.com Issue Tracking Patch Third Party Advisory