CVE-2018-3741
MEDIUM 6.1CVSS 3.1rails-html-sanitizer Cross-site Scripting vulnerability
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.
- Published
- 30 Mar 2018
- Last modified
- 17 Jun 2026
- Assigned by
- support@hackerone.com
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- GHSA-px3r-jm9g-c8w8
- Sources
- NVDJSONOSV GHSA-px3r-jm9g-c8w8JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | rubyonrails | html_sanitizercpe:2.3:a:rubyonrails:html_sanitizer:*:*:*:*:*:ruby:*:* |
<= 1.0.3 | |
| OSV | RubyGems | rails-html-sanitizer | < 1.0.4 | 1.0.4 |
References
- https://github.com/rails/rails-html-sanitizer/commit/f3ba1a839a35f2ba7f941c15e239a1cb379d56ae · Issue Tracking, Patch, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2018-3741 · ADVISORY
- https://github.com/rails/rails-html-sanitizer · PACKAGE
History
- 25 Nov 2026 20:20 UTC · NVD: first stored (published 30 Mar 2018)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 26 Apr 2018)