Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: 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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2018-3741
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 10:30 UTC · Revision 1

Source evidence

CVE-2018-3741

core-osv · Original source

Published 30 Mar 2018, 19:29 UTC

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.

osv:CVE-2018-3741
Complete source record
{
  "id": "13977a070e6f22302c671655fa3206ce753e470d366a92274f1950170fe1a41b",
  "url": "https://osv.dev/vulnerability/CVE-2018-3741",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2018-3741",
    "summary": "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.",
    "evidence": "osv:CVE-2018-3741",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2018-3741",
      "aliases": [
        "CVE-2018-3741",
        "GHSA-px3r-jm9g-c8w8"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/rails/rails-html-sanitizer",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "5c4354db7524b1df891df0a3e29877ce9f7575ca"
                },
                {
                  "fixed": "f3ba1a839a35f2ba7f941c15e239a1cb379d56ae"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:rubyonrails:html_sanitizer:*:*:*:*:*:ruby:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "1.0.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "f3ba1a839a35f2ba7f941c15e239a1cb379d56ae"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v1.0.3",
            "v1.0.2",
            "v1.0.1",
            "v1.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-3741.json"
          }
        }
      ],
      "modified": "2026-10-20T10:50:27.814719729Z",
      "provider": "osv",
      "references": [
        "https://github.com/rails/rails-html-sanitizer/commit/f3ba1a839a35f2ba7f941c15e239a1cb379d56ae"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2018-3741",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 381734,
  "published_at": "2018-03-30T19:29:00.333+00:00"
}