Skip to content

Commit b5f7445

Browse files
committed
Fix custom prefixes unduly assigning trust to external lists
Related discussion: uBlockOrigin/uBlock-issues#3843 (comment)
1 parent 5639b43 commit b5f7445

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/js/storage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,10 @@ onBroadcast(msg => {
433433
}
434434
}).filter(prefix => prefix !== undefined);
435435
}
436+
const match = /^[a-z-]+:\/\/[^/]+\//.exec(assetKey);
437+
const assetOrigin = match && match[0];
436438
for ( const prefix of this.parsedTrustedListPrefixes ) {
439+
if ( assetOrigin && prefix.length < assetOrigin.length ) { continue; }
437440
if ( assetKey.startsWith(prefix) ) { return true; }
438441
}
439442
return false;

0 commit comments

Comments
 (0)