Skip to content
Heist/ feed
Back to feed
Medium

ruby-rails-html-sanitizer — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2024-53987

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails >= 7.1.0. A possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer may allow an attacker to inject content if HTML5 sanitization is enabled and the application developer has overridden the sanitizer's allowed tags where the "style" element is explicitly allowed and the "svg" or "math" element is not allowed. This vulnerability is fixed in 1.6.1.

Products
ruby-rails-html-sanitizer
Affected versions
1.0.2-1, 1.0.3-1, 1.0.3-2, 1.0.4-1, 1.3.0-1, 1.3.0-2, 1.4.2-1, 1.4.2-2, 1.4.4-1, 1.6.2-1, 1.7.0-2, 1.7.1-1
Fixed versions
Not specified
CVEs
CVE-2024-53987
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 01:46 UTC · Revision 1

Source evidence

UBUNTU-CVE-2024-53987

core-osv · Original source

Published 2 Dec 2024, 22:15 UTC

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails >= 7.1.0. A possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer may allow an attacker to inject content if HTML5 sanitization is enabled and the application developer has overridden the sanitizer's allowed tags where the "style" element is explicitly allowed and the "svg" or "math" element is not allowed. This vulnerability is fixed in 1.6.1.

osv:UBUNTU-CVE-2024-53987

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

Complete source record
{
  "id": "629ae7ac9db86d8fe3019aebea8b68f13d6a67c75eb41f4eb20c74f244d0930a",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2024-53987",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2024-53987",
    "summary": "rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails >= 7.1.0. A possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer may allow an attacker to inject content if HTML5 sanitization is enabled and the application developer has overridden the sanitizer's allowed tags where the \"style\" element is explicitly allowed and the \"svg\" or \"math\" element is not allowed. This vulnerability is fixed in 1.6.1.",
    "evidence": "osv:UBUNTU-CVE-2024-53987",
    "products": [
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.2-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.3-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.3-2",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.3-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.0.4-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.4-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.3.0-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.3.0-2",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.4.2-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.4.2-2",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.4.4-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.4.4-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "1.6.2-1",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.6.2-1",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "1.7.0-2",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "1.7.1-1",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.6.2-1",
            "evidence": "/affected/7/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2024-53987",
      "aliases": [
        "UBUNTU-CVE-2024-53987"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=xenial",
            "ecosystem": "Ubuntu:16.04:LTS"
          },
          "versions": [
            "1.0.2-1",
            "1.0.3-1",
            "1.0.3-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53987.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.0.3-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "1.0.3-2",
            "1.0.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53987.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.0.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "1.0.4-1",
            "1.3.0-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53987.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.3.0-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "1.3.0-2",
            "1.4.2-1",
            "1.4.2-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53987.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.4.2-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "1.4.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53987.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.4.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "1.4.4-1",
            "1.6.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53987.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.6.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "1.6.2-1",
            "1.7.0-2",
            "1.7.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53987.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.7.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "1.6.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-53987.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.6.2-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:57:24.760247803Z",
      "provider": "osv",
      "upstream": [
        "CVE-2024-53987"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2024-53987",
        "https://www.cve.org/CVERecord?id=CVE-2024-53987",
        "https://github.com/rails/rails-html-sanitizer/commit/f02ffbb8465e73920b6de0da940f5530f855965e",
        "https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-2x5m-9ch4-qgrr"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2024-53987",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 357435,
  "published_at": "2024-12-02T22:15:00+00:00"
}