JavaScriptSeverity: MediumStatus: Published

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

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 (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 (“fix: reject invalid starts in unescaped selector names”) on 2026-12-02, immediately before tagging v8.1.0. Pull request 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.

Timeline

  1. Found
  2. Reported via private vulnerability report
  3. Advisory published
  4. Entry last updated

Machine-readable: JSON · Markdown · ID security/javascript/fb55__css-what/2026-10-05-selectors-css-rule-boundaries

If this work is useful to you, you can support it on Buy Me a Coffee.