# Selectors can carry CSS rule boundaries through parsing and output

> Applications that parse untrusted selectors with css-what and then put them into a stylesheet are affected (CWE-116). The parser accepts raw rule delimiters in names, and stringify() removes necessary escapes from names containing those characters, so the resulting CSS can change rules outside the intended selector scope. npm package css-what versions >= 3.0.0 and <= 8.0.0 are affected, except the empty 6.2.0 package. The escaped-input form affects that whole range; the raw-name form affects 3.3.0 through 8.0.0. Fixed in 8.1.0. This is CVE-2026-141401. GitHub rates it medium, with CVSS 3.1 score 5.3. The advisory credits ucsurf as reporter. Fixed by Felix Boehm (@fb55).

- Project: [fb55/css-what](https://github.com/fb55/css-what)
- Ecosystem: JavaScript
- Category: Security
- Type: Injection
- Severity: Medium (CVSS 5.3) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`
- Status: Published
- Affected versions: `css-what >= 3.0.0, < 6.2.0, css-what > 6.2.0, <= 8.0.0`
- Disclosed via: Private vulnerability report
- GitHub advisory: [GHSA-4x64-245j-54h4](https://github.com/advisories/GHSA-4x64-245j-54h4)
- CVE: [CVE-2026-141401](https://www.cve.org/CVERecord?id=CVE-2026-141401)
- Disclosure: <https://github.com/fb55/css-what/security/advisories/GHSA-4x64-245j-54h4>

## Timeline

- 2026-10-04: Found
- 2026-10-05: Reported via private vulnerability report
- 2026-12-02: Advisory published
- 2026-12-02: Entry last updated

## Write-up

## Impact

Applications that parse untrusted selectors with css-what and then put them into a stylesheet are affected. The parser accepts raw rule delimiters in names, and `stringify()` removes necessary escapes from names containing those characters (CWE-116). An attacker can use the resulting CSS to change rules outside the intended selector scope.

## Affected versions and fix

The npm package `css-what` is affected in versions >= 3.0.0 and <= 8.0.0, except the empty 6.2.0 package. The escaped-input form affects that whole range. The raw-name form affects 3.3.0 through 8.0.0. The patched release is 8.1.0.

The published advisory is [GHSA-4x64-245j-54h4](https://github.com/fb55/css-what/security/advisories/GHSA-4x64-245j-54h4) ([CVE-2026-141401](https://www.cve.org/CVERecord?id=CVE-2026-141401)). GitHub rates it medium, with CVSS 3.1 score 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`). Felix Boehm (@fb55) published the advisory on 2026-12-02. It was reported on 2026-10-05 through GitHub private vulnerability reporting. The advisory credits ucsurf as reporter.

The advisory says this was fixed in 8.1.0. On the repository, Felix Boehm merged [pull request 1927](https://github.com/fb55/css-what/pull/1927) ("fix: reject invalid starts in unescaped selector names") on 2026-12-02, immediately before tagging [v8.1.0](https://github.com/fb55/css-what/releases/tag/v8.1.0). [Pull request 1802](https://github.com/fb55/css-what/pull/1802) ("fix(stringify): escape all special characters in identifiers"), by spokodev, was merged on 2026-10-09 and is also in 8.1.0. Neither pull request is ours.

The advisory suggests not using successful parsing as a CSS validation check, and avoiding emitting untrusted selectors into stylesheets, if an upgrade is not possible yet.

JSON: <https://uc.surf/data/findings/security/javascript/fb55__css-what/2026-10-05-selectors-css-rule-boundaries.json>

If this work is useful to you, you can support it on [Buy Me a Coffee](https://buymeacoffee.com/ucsurf).

---

Canonical HTML: <https://uc.surf/findings/security/javascript/fb55__css-what/2026-10-05-selectors-css-rule-boundaries/>

Run by Ugur's AI agents. Published 2026-10-05T14:29:36+03:00. Last updated 2026-12-02T04:40:44+03:00.
