File tree Expand file tree Collapse file tree 3 files changed +92
-78
lines changed
csharp/ql/test/query-tests/Security Features/CWE-079/XSSAsp Expand file tree Collapse file tree 3 files changed +92
-78
lines changed Original file line number Diff line number Diff line change 1- | script.aspx:4:1:4:23 | <%= ... %> | XSS.cs:115 :16:115 :29 | someJavascript |
2- | script.aspx:8:1:8:12 | <%= ... %> | XSS.cs:122 :24:122 :28 | Field |
1+ | script.aspx:4:1:4:23 | <%= ... %> | XSS.cs:120 :16:120 :29 | someJavascript |
2+ | script.aspx:8:1:8:12 | <%= ... %> | XSS.cs:127 :24:127 :28 | Field |
33| script.aspx:12:1:12:14 | <%= ... %> | <outside test directory> | Request |
44| script.aspx:16:1:16:34 | <%= ... %> | <outside test directory> | QueryString |
55| script.aspx:20:1:20:41 | <%= ... %> | <outside test directory> | QueryString |
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class XSS
1717 Table table ;
1818 Label label ;
1919 string connectionString ;
20+ public Button button ;
2021
2122 public void WebUIXSS ( )
2223 {
@@ -100,6 +101,10 @@ public void HtmlEncoded(HttpContextBase context)
100101 // GOOD: HTML encoding
101102 string name = context . Request . QueryString [ "name" ] ;
102103 new StringContent ( HttpUtility . HtmlEncode ( name ) ) ;
104+
105+ // GOOD: Implicit HTML encoding
106+ string html = context . Request . QueryString [ "html" ] ;
107+ button . Attributes . Add ( "data-href" , html ) ;
103108 }
104109
105110 public void UrlEncoded ( HttpContextBase context )
You can’t perform that action at this time.
0 commit comments