Skip to content
Heist/ feed
Back to feed
HighFix available

ruby-sanitize — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2020-4054

In Sanitize (RubyGem sanitize) greater than or equal to 3.0.0 and less than 5.2.1, there is a cross-site scripting vulnerability. When HTML is sanitized using Sanitize's "relaxed" config, or a custom config that allows certain elements, some content in a math or svg element may not be sanitized correctly even if math and svg are not in the allowlist. You are likely to be vulnerable to this issue if you use Sanitize's relaxed config or a custom config that allows one or more of the following HTML elements: iframe, math, noembed, noframes, noscript, plaintext, script, style, svg, xmp. Using carefully crafted input, an attacker may be able to sneak arbitrary HTML through Sanitize, potentially resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. This has been fixed in 5.2.1.

Products
ruby-sanitize
Affected versions
Not specified
Fixed versions
4.6.6-2.1
CVEs
CVE-2020-4054
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 14:05 UTC · Revision 1

Source evidence

DEBIAN-CVE-2020-4054

core-osv · Original source

Published 16 Jun 2020, 22:15 UTC

In Sanitize (RubyGem sanitize) greater than or equal to 3.0.0 and less than 5.2.1, there is a cross-site scripting vulnerability. When HTML is sanitized using Sanitize's "relaxed" config, or a custom config that allows certain elements, some content in a math or svg element may not be sanitized correctly even if math and svg are not in the allowlist. You are likely to be vulnerable to this issue if you use Sanitize's relaxed config or a custom config that allows one or more of the following HTML elements: iframe, math, noembed, noframes, noscript, plaintext, script, style, svg, xmp. Using carefully crafted input, an attacker may be able to sneak arbitrary HTML through Sanitize, potentially resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. This has been fixed in 5.2.1.

osv:DEBIAN-CVE-2020-4054

ruby-sanitize

Fixed versions: 4.6.6-2.1

ruby-sanitize

Fixed versions: 4.6.6-2.1

ruby-sanitize

Fixed versions: 4.6.6-2.1

Complete source record
{
  "id": "ff6e9e70d3548b3785db624fe124351cf020223be5a0e82c344c8ca366365701",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2020-4054",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2020-4054",
    "summary": "In Sanitize (RubyGem sanitize) greater than or equal to 3.0.0 and less than 5.2.1, there is a cross-site scripting vulnerability. When HTML is sanitized using Sanitize's \"relaxed\" config, or a custom config that allows certain elements, some content in a math or svg element may not be sanitized correctly even if math and svg are not in the allowlist. You are likely to be vulnerable to this issue if you use Sanitize's relaxed config or a custom config that allows one or more of the following HTML elements: iframe, math, noembed, noframes, noscript, plaintext, script, style, svg, xmp. Using carefully crafted input, an attacker may be able to sneak arbitrary HTML through Sanitize, potentially resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. This has been fixed in 5.2.1.",
    "evidence": "osv:DEBIAN-CVE-2020-4054",
    "products": [
      {
        "name": {
          "value": "ruby-sanitize",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.6.6-2.1",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "ruby-sanitize",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.6.6-2.1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "ruby-sanitize",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.6.6-2.1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2020-4054",
      "aliases": [
        "DEBIAN-CVE-2020-4054"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "4.6.6-2.1"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-sanitize",
            "purl": "pkg:deb/debian/ruby-sanitize?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2020-4054.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "4.6.6-2.1"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-sanitize",
            "purl": "pkg:deb/debian/ruby-sanitize?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2020-4054.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "4.6.6-2.1"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-sanitize",
            "purl": "pkg:deb/debian/ruby-sanitize?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2020-4054.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-26T12:02:50.191097998Z",
      "provider": "osv",
      "upstream": [
        "CVE-2020-4054"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2020-4054"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2020-4054",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 453112,
  "published_at": "2020-06-16T22:15:10.693+00:00"
}