Skip to content
Heist/ feed
Back to feed
Medium

Sanitize vulnerable to Cross-site Scripting via Improper neutralization of `noscript` element

Type: advisorySources: OSV

Sanitize is an allowlist-based HTML and CSS sanitizer. Versions 5.0.0 and later, prior to 6.0.1, are vulnerable to Cross-site Scripting. When Sanitize is configured with a custom allowlist that allows `noscript` elements, attackers are able to include arbitrary HTML, resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. The default configurations do not allow `noscript` elements and are not vulnerable. This issue only affects users who are using a custom config that adds `noscript` to the element allowlist. This issue has been patched in version 6.0.1. Users who are unable to upgrade can prevent this issue by using one of Sanitize's default configs or by ensuring that their custom config does not include `noscript` in the element allowlist.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2023-23627
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 23:41 UTC · Revision 1

Source evidence

Sanitize vulnerable to Cross-site Scripting via Improper neutralization of `noscript` element

core-osv · Original source

Published 27 Jan 2023, 23:44 UTC

Sanitize is an allowlist-based HTML and CSS sanitizer. Versions 5.0.0 and later, prior to 6.0.1, are vulnerable to Cross-site Scripting. When Sanitize is configured with a custom allowlist that allows `noscript` elements, attackers are able to include arbitrary HTML, resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. The default configurations do not allow `noscript` elements and are not vulnerable. This issue only affects users who are using a custom config that adds `noscript` to the element allowlist. This issue has been patched in version 6.0.1. Users who are unable to upgrade can prevent this issue by using one of Sanitize's default configs or by ensuring that their custom config does not include `noscript` in the element allowlist.

osv:CVE-2023-23627
Complete source record
{
  "id": "7f13cab68e39cc94c8edb0cfc176ec102471a5c8b5e2b7e2320e532ba9542b45",
  "url": "https://osv.dev/vulnerability/CVE-2023-23627",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Sanitize vulnerable to Cross-site Scripting via Improper neutralization of `noscript` element",
    "summary": "Sanitize is an allowlist-based HTML and CSS sanitizer. Versions 5.0.0 and later, prior to 6.0.1, are vulnerable to Cross-site Scripting. When Sanitize is configured with a custom allowlist that allows `noscript` elements, attackers are able to include arbitrary HTML, resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. The default configurations do not allow `noscript` elements and are not vulnerable. This issue only affects users who are using a custom config that adds `noscript` to the element allowlist. This issue has been patched in version 6.0.1. Users who are unable to upgrade can prevent this issue by using one of Sanitize's default configs or by ensuring that their custom config does not include `noscript` in the element allowlist.",
    "evidence": "osv:CVE-2023-23627",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2023-23627",
      "aliases": [
        "CVE-2023-23627",
        "GHSA-fw3g-2h3j-qmm7"
      ],
      "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/rgrove/sanitize",
              "type": "GIT",
              "events": [
                {
                  "introduced": "424f02f4fd279e650117d32388d0840097dbc4c9"
                },
                {
                  "fixed": "a92f21cd223a32a1737262d68e56a4fb8b9470f9"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "5.0.0"
                      },
                      {
                        "fixed": "6.0.1"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "cpe": "cpe:2.3:a:sanitize_project:sanitize:*:*:*:*:*:ruby:*:*",
                    "range": [
                      {
                        "introduced": "5.0.0"
                      },
                      {
                        "fixed": "6.0.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v6.0.0",
            "v5.2.3",
            "v5.2.2",
            "v5.2.1",
            "v5.2.0",
            "v5.1.0",
            "v5.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-23627.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:24.431503599Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/23xxx/CVE-2023-23627.json",
        "https://github.com/rgrove/sanitize/security/advisories/GHSA-fw3g-2h3j-qmm7",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-23627"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-79"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/23xxx/CVE-2023-23627.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-23627",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 490941,
  "published_at": "2023-01-27T23:44:17.617+00:00"
}