Skip to content
Heist/ feed
Back to feed
Low

Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0

Type: advisorySources: OSV

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 and Nokogiri < 1.15.7, or 1.16.x < 1.16.8. The 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 with both "math" and "style" elements or both both "svg" and "style" elements. This vulnerability is fixed in 1.6.1.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-53985
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 12:27 UTC · Revision 1

Source evidence

Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0

core-osv · Original source

Published 2 Dec 2024, 21: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 and Nokogiri < 1.15.7, or 1.16.x < 1.16.8. The 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 with both "math" and "style" elements or both both "svg" and "style" elements. This vulnerability is fixed in 1.6.1.

osv:CVE-2024-53985
Complete source record
{
  "id": "9a307aa2fc35c86fd4ef190e515965e3ade92900b723159dc8664f9d2544a234",
  "url": "https://osv.dev/vulnerability/CVE-2024-53985",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0",
    "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 and Nokogiri < 1.15.7, or 1.16.x < 1.16.8. The 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 with both \"math\" and \"style\" elements or both both \"svg\" and \"style\" elements. This vulnerability is fixed in 1.6.1.",
    "evidence": "osv:CVE-2024-53985",
    "products": [],
    "severity": "low",
    "structured": {
      "id": "CVE-2024-53985",
      "aliases": [
        "CVE-2024-53985",
        "GHSA-w8gc-x259-rc7x"
      ],
      "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/rails/rails-html-sanitizer",
              "type": "GIT",
              "events": [
                {
                  "introduced": "19fd6cd66f31316642e758bf01a410f3fd128f42"
                },
                {
                  "fixed": "5e96b19bbb934284e675109851bd82429622bb6e"
                },
                {
                  "fixed": "b0220b8850d52199a15f83c472d175a4122dd7b1"
                },
                {
                  "fixed": "cd18b0ef00aad1d4a9e1c5d860cd23f80f63c505"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "1.6.0"
                      },
                      {
                        "fixed": "1.6.1"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "b0220b8850d52199a15f83c472d175a4122dd7b1"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "cd18b0ef00aad1d4a9e1c5d860cd23f80f63c505"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.6.0",
            "v1.6.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-53985.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:50.778826131Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/53xxx/CVE-2024-53985.json",
        "https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-w8gc-x259-rc7x",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-53985",
        "https://github.com/rails/rails-html-sanitizer/commit/b0220b8850d52199a15f83c472d175a4122dd7b1",
        "https://github.com/rails/rails-html-sanitizer/commit/cd18b0ef00aad1d4a9e1c5d860cd23f80f63c505"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/53xxx/CVE-2024-53985.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-53985",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 519285,
  "published_at": "2024-12-02T21:15:57.62+00:00"
}