Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -826,6 +826,18 @@ |
} |
} |
+ // For security reasons, never match $rewrite filters |
+ // against requests that might load any code to be executed. |
+ if (rewrite != null) |
+ { |
+ if (contentType == null) |
+ ({contentType} = RegExpFilter.prototype); |
+ contentType &= ~(RegExpFilter.typeMap.SCRIPT | |
+ RegExpFilter.typeMap.SUBDOCUMENT | |
+ RegExpFilter.typeMap.OBJECT | |
+ RegExpFilter.typeMap.OBJECT_SUBREQUEST); |
+ } |
+ |
try |
{ |
if (blocking) |