Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1309)

Unified Diff: Source/devtools/scripts/check_injected_script_source.py

Issue 445333005: DevTools: Fix tainted Function.prototype methods may disable console. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/scripts/check_injected_script_source.py
diff --git a/Source/devtools/scripts/check_injected_script_source.py b/Source/devtools/scripts/check_injected_script_source.py
index fc799b1fdcb9f0edf3bf32d9e0314c02ecba4973..18d1e8a542888f8eca3b0b7f923eb6e767c732b2 100755
--- a/Source/devtools/scripts/check_injected_script_source.py
+++ b/Source/devtools/scripts/check_injected_script_source.py
@@ -37,14 +37,20 @@ def validate_injected_script(fileName):
lines = f.readlines()
f.close()
- array_proto_functions = "|".join(["concat", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "map", "pop", "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift"])
+ proto_functions = "|".join([
+ # Array.prototype.*
+ "concat", "every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "map", "pop",
+ "push", "reduce", "reduceRight", "reverse", "shift", "slice", "some", "sort", "splice", "toLocaleString", "toString", "unshift",
+ # Function.prototype.*
+ "apply", "bind", "call", "isGenerator", "toSource",
+ ])
# Black list:
- # - Function.prototype.bind()
# - Object.prototype.toString()
# - Array.prototype.*
+ # - Function.prototype.*
# - Math.*
- black_list_call_regex = re.compile(r"\bMath\.\w+\(|\.(bind|toString|" + array_proto_functions + r")\(")
+ black_list_call_regex = re.compile(r"\bMath\.\w+\(|\.(toString|" + proto_functions + r")\(")
errors_found = False
for i, line in enumerate(lines):

Powered by Google App Engine
This is Rietveld 408576698