From 5d22b51668ef3912192e5fbca68c9d6efdc9ba8a Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 11 Nov 2021 08:33:28 -0500 Subject: [PATCH] Forbid usage of `inage-set` as style property Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1811 Additionally, forbid style declaration with at least one instance of `//` at any position. --- src/js/static-filtering-parser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 16b9c3704..00cdcd074 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -1565,11 +1565,13 @@ Parser.prototype.SelectorCompiler = class { // https://github.com/uBlockOrigin/uBlock-issues/issues/668 // https://github.com/uBlockOrigin/uBlock-issues/issues/1693 // Forbid instances of: + // - `image-set(` // - `url(` + // - any instance of `//` // - backslashes `\` // - opening comment `/*` compileStyleProperties(s) { - if ( /url\(|\\|\/\*/i.test(s) ) { return; } + if ( /image-set\(|url\(|\/\/|\\|\/\*/i.test(s) ) { return; } if ( this.stylesheet === null ) { return s; } let valid = false; try {