CVE-2018-3741 · hackerone
CVE-2018-3741
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 2018-03-30, last changed 2026-06-17. Weakness: CWE-79.
How to fix
Upgrade to a fixed version: rails-html-sanitizer 1.0.4 (RubyGems). For the version that clears every advisory for your installed version, ask an agent for get_remediation.
Where the flaw is in the code
Fixed in rails/rails-html-sanitizer by f3ba1a839a. Functions changed by the fix: scrub_attribute. Regression tests: test/sanitizer_test.rb. Confidence: verified (a record names this commit as the fix, and it changed these functions).
Timeline
| 2018-03-30 | Published |
| 2018-04-26 | Package advisory GHSA-px3r-jm9g-c8w8 |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 1.25% |
| 2026-12-03 | Code-level analysis added |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-px3r-jm9g-c8w8 | rails-html-sanitizer (RubyGems) | 1.0.4 |
Also known as: GHSA-px3r-jm9g-c8w8
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2026-128069 | 2026-11-13 | 4.7 | rails-html-sanitizer: Possible XSS via shared scrubber state in concurrent calls |
| CVE-2026-128068 | 2026-11-13 | 5.3 | rails-html-sanitizer: Possible regular expression denial of service with certain configurations |
| CVE-2026-73648 | 2026-08-13 | 5.1 | rails-html-sanitizer: Possible XSS vulnerability with certain configurations |
| CVE-2024-53988 | 2024-12-02 | 6.1 | Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0 |
| CVE-2024-53987 | 2024-12-02 | 6.1 | Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0 |
| CVE-2024-53986 | 2024-12-02 | 6.1 | Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0 |
| CVE-2024-53985 | 2024-12-02 | 6.1 | Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0 |
| CVE-2024-53989 | 2024-12-02 | 6.1 | Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0 |
Add it to your agent
One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.
claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp
Then ask for triage_cve CVE-2018-3741, or call /api/v1/vulnerabilities/CVE-2018-3741. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.