Cross-site Scripting (XSS) Affecting ruff package, versions *


Severity

Recommended
medium

Based on Red Hat Enterprise Linux security rating.

Threat Intelligence

EPSS
0.04% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Scripting (XSS) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RHEL10-RUFF-16329038
  • published1 May 2026
  • disclosed23 Apr 2026

Introduced: 23 Apr 2026

NewCVE-2026-41240  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

There is no fixed version for RHEL:10 ruff.

NVD Description

Note: Versions mentioned in the description apply only to the upstream ruff package and not the ruff package as distributed by RHEL. See How to fix? for RHEL:10 relevant fixed versions and status.

DOMPurify is a DOM-only cross-site scripting sanitizer for HTML, MathML, and SVG. Versions prior to 3.4.0 have an inconsistency between FORBID_TAGS and FORBID_ATTR handling when function-based ADD_TAGS is used. Commit c361baa added an early exit for FORBID_ATTR at line 1214. The same fix was not applied to FORBID_TAGS. At line 1118-1123, when EXTRA_ELEMENT_HANDLING.tagCheck returns true, the short-circuit evaluation skips the FORBID_TAGS check entirely. This allows forbidden elements to survive sanitization with their attributes intact. Version 3.4.0 patches the issue.

CVSS Base Scores

version 3.1