CVE-2018-8048 · mitre
CVE-2018-8048
In the Loofah gem through 2.2.0 for Ruby, non-whitelisted HTML attributes may occur in sanitized output by republishing a crafted HTML fragment.
Published 2018-03-27, last changed 2026-06-17. Weakness: CWE-79.
How to fix
Upgrade to a fixed version: loofah 2.2.1 (RubyGems); nokogiri 1.8.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 flavorjones/loofah by 7541374548, f739cf8eac. Functions changed by the fix: scrub_attributes, scrub_css, force_correct_attribute_escaping!. Regression tests: test/integration/test_ad_hoc.rb. Confidence: verified (a record names this commit as the fix, and it changed these functions).
Timeline
| 2018-03-21 | Package advisory GHSA-x7rv-cr6v-4vm4 |
| 2018-03-27 | Published |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 1.93% |
| 2026-12-02 | Code-level analysis added |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-x7rv-cr6v-4vm4 | loofah (RubyGems) | 2.2.1 |
| GHSA-x7rv-cr6v-4vm4 | nokogiri (RubyGems) | 1.8.3 |
Also known as: GHSA-x7rv-cr6v-4vm4
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2026-126209 | 2026-11-12 | 5.3 | Loofah allowed_uri? treats javascript: alert(1) as safe |
| CVE-2026-126208 | 2026-11-12 | 4.7 | Loofah: SVG ` ` and ` ` bypass local-reference restriction |
| CVE-2026-126207 | 2026-11-12 | 4.7 | Loofah: CSS url() sanitization bypass via escaped parentheses |
| CVE-2026-126206 | 2026-11-12 | 5.3 | Loofah allowed_uri? treats data:text/html as safe text/plain |
| CVE-2026-126205 | 2026-11-12 | 5.3 | Loofah: Regular expression denial of service in the SVG local-reference check |
| CVE-2026-126203 | 2026-11-12 | 6.1 | Loofah: Mutation XSS in the HTML5 scrubbers through unescaped attribute values |
| CVE-2026-73492 | 2026-08-12 | 2.3 | Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons |
| CVE-2026-73491 | 2026-08-12 | 2.3 | Loofah `allowed_uri?` does not detect `javascript:` URIs split by named whitespace character references |
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-8048, or call /api/v1/vulnerabilities/CVE-2018-8048. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.