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

Unified Diff: LayoutTests/http/tests/security/xssAuditor/resources/echo-intertag.pl

Issue 421623003: XSSAuditor: treat questionmark as a non-canonical character. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | LayoutTests/http/tests/security/xssAuditor/script-tag-replaced-with-questionmark.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/xssAuditor/resources/echo-intertag.pl
diff --git a/LayoutTests/http/tests/security/xssAuditor/resources/echo-intertag.pl b/LayoutTests/http/tests/security/xssAuditor/resources/echo-intertag.pl
index b2407deb4e4f6ed6bc9f8ad138f64aa8b3011a81..b790d513878ad393e9b2ce3026ba97b59d7f5b7f 100755
--- a/LayoutTests/http/tests/security/xssAuditor/resources/echo-intertag.pl
+++ b/LayoutTests/http/tests/security/xssAuditor/resources/echo-intertag.pl
@@ -92,7 +92,11 @@ if ($cgi->param('inHead')) {
if ($cgi->param('replaceState')) {
print "<script>history.replaceState({}, '', '#must-not-appear');</script>\n";
}
-print $cgi->param('q'); # XSS reflected here.
+my $reflection = $cgi->param('q');
+my $pattern = "\xfe";
+my $replacement = "?";
+$reflection =~ s/$pattern/$replacement/g; # pretend server translates high character 0xfe into literal "?".
+print $reflection; # XSS reflected here.
if ($cgi->param('script-expression-follows')) {
print "\n <script>42;</script>\n";
}
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/xssAuditor/script-tag-replaced-with-questionmark.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698