CVE-2018-3740 · hackerone
CVE-2018-3740
A specially crafted HTML fragment can cause Sanitize gem for Ruby to allow non-whitelisted attributes to be used on a whitelisted HTML element.
Published 2018-03-30, last changed 2026-06-17. Weakness: CWE-79, CWE-20.
How to fix
Upgrade to a fixed version: sanitize 4.6.3 (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 rgrove/sanitize by 01629a162e, 93feeb38e2. Functions changed by the fix: call. Regression tests: test/test_clean_element.rb, test/test_malicious_html.rb. Confidence: verified (a record names this commit as the fix, and it changed these functions).
Timeline
| 2018-03-21 | Package advisory GHSA-7f42-p84j-f58p |
| 2018-03-30 | Published |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 1.47% |
| 2026-12-03 | Code-level analysis added |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-7f42-p84j-f58p | sanitize (RubyGems) | 4.6.3 |
Also known as: GHSA-7f42-p84j-f58p
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2023-36823 | 2023-07-06 | 6.1 | Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content |
| CVE-2023-23627 | 2023-01-28 | 6.1 | Sanitize vulnerable to Cross-site Scripting via Improper neutralization of `noscript` element |
| CVE-2020-4054 | 2020-06-16 | 7.3 | Cross-site Scripting in Sanitize |
| CVE-2026-133211 | 2026-11-26 | 4.7 | same weakness (CWE-79, CWE-20) from the same CNA (hackerone) |
| CVE-2026-133208 | 2026-11-26 | 6.1 | same weakness (CWE-79, CWE-20) from the same CNA (hackerone) |
| CVE-2026-108565 | 2026-11-11 | 4.7 | same weakness (CWE-79, CWE-20) from the same CNA (hackerone) |
| CVE-2026-108564 | 2026-11-11 | 4.7 | same weakness (CWE-79, CWE-20) from the same CNA (hackerone) |
| CVE-2026-108562 | 2026-11-11 | 5.4 | same weakness (CWE-79, CWE-20) from the same CNA (hackerone) |
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-3740, or call /api/v1/vulnerabilities/CVE-2018-3740. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.