KeygraphLabs · CVE MCP

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.

CVSS
6.1
medium, from NVD
EPSS
1.25%
percentile 70.5%, chance of exploitation in 30 days
Exploitation
None known
no KEV listing or public exploit in our indexes

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-30Published
2018-04-26Package advisory GHSA-px3r-jm9g-c8w8
2026-06-17Record last changed
2026-11-30EPSS when our history starts: 1.25%
2026-12-03Code-level analysis added

Affected packages

AdvisoryPackageFixed in
GHSA-px3r-jm9g-c8w8rails-html-sanitizer (RubyGems)1.0.4

Also known as: GHSA-px3r-jm9g-c8w8

Related

CVEPublishedCVSSSummary
CVE-2026-1280692026-11-134.7rails-html-sanitizer: Possible XSS via shared scrubber state in concurrent calls
CVE-2026-1280682026-11-135.3rails-html-sanitizer: Possible regular expression denial of service with certain configurations
CVE-2026-736482026-08-135.1rails-html-sanitizer: Possible XSS vulnerability with certain configurations
CVE-2024-539882024-12-026.1Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
CVE-2024-539872024-12-026.1Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
CVE-2024-539862024-12-026.1Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
CVE-2024-539852024-12-026.1Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
CVE-2024-539892024-12-026.1Possible 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.

NVD · CVE.org