refactor: detect external CSS references with the CSS Syntax tokenizer

Replace the regex/escape-normalizer with @csstools/css-tokenizer (already
present transitively). Tokenizing resolves comments, hex escapes, and line
continuations into the real value before scanning, so obfuscated forms (a
scheme split by a line continuation or hex escape) cannot slip past. Scan
url-tokens and string-tokens to cover url(), quoted @import, and string-form
image functions. Add regression tests for the bypasses.
This commit is contained in:
Buco7854 committed 2026-06-23 19:25:18 +00:00
1 parent 3685e0c476
commit 96021b7479
4 files changed
+26 -18

No files matched your search

+1
View File
@@ -31,6 +31,7 @@
"node": ">=20"
},
"dependencies": {
"@csstools/css-tokenizer": "^3.0.4",
"@grpc/grpc-js": "^1.14.3",
"@grpc/proto-loader": "^0.8.0",
"@pulsecron/pulse": "1.6.8",