CVE-2026-126207: Loofah: CSS url() sanitization bypass via escaped parentheses

Published Nov 12, 2026
·
Updated

Summary

Loofah::HTML5::Scrub.scrubcss rejected any property whose top-level Crass tokens included a :url or :badurl, and left url out of the allowed CSS functions. Both checks ran only against the first parse of the style attribute. When scrubcss rebuilt each property it emitted identifiers with their CSS escapes decoded, so parentheses written as escapes — url\28 …\29 — hid the url token from the checks, and the rebuilt value was re-parsed into a live url() that nothing checked again. An escaped property name, six-digit escapes, escaped comments and escaped quotes all reached the same place.

Impact

A sanitized style attribute could make a viewer's browser issue a request to an attacker-chosen URL. list-style fetches on render with no interaction, cursor on hover. That leaks the viewer's IP address, user agent and access timing, and can reach hosts routable only from the viewer's network. No script survives sanitization and the attacker cannot read the response, so the request itself is the whole impact.

Applications that sanitize user-supplied HTML with Loofah's default allowlist and display it to other people are affected.

Mitigation

Upgrade to Loofah >= 2.25.3.

Credit

Reported by NotAFlightRisk through GitHub's private vulnerability reporting.

Other sources

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.scrubcss 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.

— MITRE

Affected Software

1 affected componentFixes available
rubygems/loofah<2.25.3
2.25.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/loofah to a version that resolves this vulnerability.

    Fixed in 2.25.3
  2. Upgrade

    Upgrade Loofah to a version that resolves this vulnerability.

    Fixed in 2.25.3

Event History

Nov 12, 2026
CVE Published
via MITRE·08:53 PM
Data Sourced
via MITRE·08:53 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·09:05 PM
Data Sourced
via GitHub·09:05 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are realistically exposed?

Applications that sanitize user-supplied HTML using Loofah's default allowlist and then render that HTML for other users are affected. The issue is relevant where untrusted users can supply style attributes that will be displayed in another viewer's browser.

2

What does an attacker need to exploit this?

The attacker needs a way to submit HTML containing a crafted style attribute that passes through Loofah sanitization and is later rendered. Exploitation relies on CSS escapes, such as escaped parentheses in url(), to bypass the initial token checks.

3

Are default Loofah sanitization settings affected?

Yes. The described affected scenario explicitly includes applications using Loofah's default allowlist to sanitize user-supplied HTML.

4

What is the practical impact after successful exploitation?

A viewer's browser can request an attacker-chosen URL, potentially including hosts reachable only from that viewer's network. This can disclose the viewer's IP address, user agent, and access timing; the attacker cannot read the response, and no script survives sanitization.

5

Does exploitation require viewer interaction?

Not always. A list-style URL can be fetched when the content renders without interaction, while a cursor URL is fetched when the viewer hovers over the affected element.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203