CVE-2026-126207

Loofah: CSS url() sanitization bypass via escaped parentheses

Published Nov 12, 2026 CVSS 3.1 · 4.7 Medium EPSS < 1% KEV · Not listed
Description
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Prior to 2.25.3, Loofah::HTML5::Scrub.scrub_css checks only the first parse of a style attribute, then rebuilds CSS with identifier escapes decoded so escaped parentheses, property names, comments, or quotes can become a live url() without a second safety check. An attacker can use list-style to make a viewer's browser request an attacker-chosen URL when content renders, or cursor to make the request on hover. The request can disclose the viewer's IP address, user agent, access timing, and access to internal-network hosts, but no script survives sanitization and the attacker cannot read the response. This issue is fixed in version 2.25.3.

Analysis

AI-generated

Technical impact

Loofah, a Ruby library used to manipulate HTML and XML, performed a one‑time parse of a style attribute before rebuilding CSS. The rebuild decoded escaped parentheses, property names, comments, or quotes, allowing an attacker to inject a CSS url() that becomes live on a second pass. When a privileged user renders the HTML, the browser will request the attacker‑chosen URL, leaking the viewer’s IP address, user agent, access timing, and access to internal hosts. No executable script can survive the sanitization, so the attacker can only observe information, not execute code. The flaw maps to CWE‑180 (Invalidated Data Not Correctly Sanitized) and CWE‑184 (Excessive Privilege Usage).

Affected Systems

The vulnerability affects the flavorjones:loofah Ruby gem, specifically any release prior to version 2.25.3. Systems that embed Loofah in web applications, content management systems, or email processing pipelines and that render user supplied or external HTML to browsers are at risk.

Risk and Exploitability

The CVSS score is 4.7, indicating low‑to‑moderate risk for confidentiality. The EPSS score is below 1 %, suggesting a very low probability of current exploitation. The vulnerability is not listed in the CISA KEV catalog. Attackers need to supply crafted HTML that is viewed by a user; the exploitation surface is therefore limited to environments where user‑rendered content is processed by Loofah. Given the limited impact and low exploitation likelihood, the overall risk is mild but non‑negligible.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Loofah gem to version 2.25.3 or later to apply the CSS sanitization patch.
  • If an upgrade is not immediately possible, strip or remove style attributes from parsed HTML before rendering to the browser.
  • Validate or whitelist CSS content, ensuring no url() functions are present, or disable CSS parsing altogether for untrusted input.

Generated by OpenCVE AI on November 13, 2026 at 15:16 UTC.

Tracking

Sign in to view the affected projects.

Exploits

Explore public exploit intelligence with OpenCVE Pro.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-m3x9-938q-5767 Loofah: CSS url() sanitization bypass via escaped parentheses
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Flavorjones
Flavorjones loofah
Vendors & Products Flavorjones
Flavorjones loofah
Type Values Removed Values Added
Description Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Prior to 2.25.3, Loofah::HTML5::Scrub.scrub_css checks only the first parse of a style attribute, then rebuilds CSS with identifier escapes decoded so escaped parentheses, property names, comments, or quotes can become a live url() without a second safety check. An attacker can use list-style to make a viewer's browser request an attacker-chosen URL when content renders, or cursor to make the request on hover. The request can disclose the viewer's IP address, user agent, access timing, and access to internal-network hosts, but no script survives sanitization and the attacker cannot read the response. This issue is fixed in version 2.25.3.
Title Loofah: CSS url() sanitization bypass via escaped parentheses
Weaknesses CWE-180
CWE-184
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N'}

Weaknesses
  • CWE-180

    Incorrect Behavior Order: Validate Before Canonicalize

  • CWE-184

    Incomplete List of Disallowed Inputs

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 13, 2026, 7:43 PM
Reserved
Nov 10, 2026, 8:07 PM
Status
Awaiting Analysis
Published
Nov 12, 2026, 9:17 PM
Modified
Nov 13, 2026, 8:18 PM