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

Unified Diff: third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp

Issue 2036493005: Treat % as a non-canoncial character (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp
index aabb158e0afc3729bf6b90e8bd1326735725c539..f2fc50cae37335cc5f0f2c18bb26a04248129561 100644
--- a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp
+++ b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp
@@ -73,8 +73,10 @@ static bool isNonCanonicalCharacter(UChar c)
// We also remove the questionmark character, since some severs replace invalid high-bytes with a questionmark. We
// are already stripping the high-bytes so we also strip the questionmark to match.
//
+ // We also move the percent character, since some servers strip it when there's a malformed sequence.
+ //
// For instance: new String("http://localhost:8000?x") => new String("http:localhost:8x").
- return (c == '\\' || c == '0' || c == '\0' || c == '/' || c == '?' || c >= 127);
+ return (c == '\\' || c == '0' || c == '\0' || c == '/' || c == '?' || c == '%' || c >= 127);
}
static bool isRequiredForInjection(UChar c)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698