mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Fix custom prefixes unduly assigning trust to external lists
Related discussion: https://github.com/uBlockOrigin/uBlock-issues/issues/3843#issuecomment-3475894380
This commit is contained in:
parent
5639b43731
commit
b5f74456a4
1 changed files with 3 additions and 0 deletions
|
|
@ -433,7 +433,10 @@ onBroadcast(msg => {
|
|||
}
|
||||
}).filter(prefix => prefix !== undefined);
|
||||
}
|
||||
const match = /^[a-z-]+:\/\/[^/]+\//.exec(assetKey);
|
||||
const assetOrigin = match && match[0];
|
||||
for ( const prefix of this.parsedTrustedListPrefixes ) {
|
||||
if ( assetOrigin && prefix.length < assetOrigin.length ) { continue; }
|
||||
if ( assetKey.startsWith(prefix) ) { return true; }
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue