From 45f26d73197de38b8912ab5823317a7cf3ff189b Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 10 Aug 2020 10:56:28 -0400 Subject: [PATCH] Better parsing of hosts file system addresses Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/877 --- src/js/static-filtering-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 67ec82bfb..1a7a6ddf1 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -102,7 +102,7 @@ const Parser = class { this.netOptionsIterator = new NetOptionsIterator(this); this.extOptionsIterator = new ExtOptionsIterator(this); this.maxTokenLength = Number.MAX_SAFE_INTEGER; - this.reIsLocalhostRedirect = /(?:0\.0\.0\.0|(?:broadcast|local)host|local|ip6-\w+)\b/; + this.reIsLocalhostRedirect = /(?:0\.0\.0\.0|(?:broadcast|local)host|local|ip6-\w+)(?:[^\w.-]|$)/; this.reHostname = /^[^\x00-\x24\x26-\x29\x2B\x2C\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]+/; this.reHostsSink = /^[\w-.:\[\]]+$/; this.reHostsSource = /^[^\x00-\x24\x26-\x29\x2B\x2C\x2F\x3A-\x40\x5B-\x5E\x60\x7B-\x7F]+$/;