File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
csharp/ql/test/query-tests/Security Features/CWE-601/UrlRedirect Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1
1
edges
2
+ | UrlRedirect2.cs:14:31:14:53 | access to property QueryString : NameValueCollection | UrlRedirect2.cs:14:31:14:61 | access to indexer | provenance | |
2
3
| UrlRedirect.cs:13:31:13:53 | access to property QueryString : NameValueCollection | UrlRedirect.cs:13:31:13:61 | access to indexer | provenance | |
3
4
| UrlRedirect.cs:23:22:23:44 | access to property QueryString : NameValueCollection | UrlRedirect.cs:23:22:23:52 | access to indexer : String | provenance | |
4
5
| UrlRedirect.cs:23:22:23:44 | access to property QueryString : NameValueCollection | UrlRedirect.cs:48:29:48:31 | access to local variable url | provenance | |
28
29
| UrlRedirectCore.cs:45:51:45:55 | value : String | UrlRedirectCore.cs:56:31:56:35 | access to parameter value | provenance | |
29
30
| UrlRedirectCore.cs:53:40:53:44 | access to parameter value : String | UrlRedirectCore.cs:53:32:53:45 | object creation of type Uri | provenance | |
30
31
nodes
32
+ | UrlRedirect2.cs:14:31:14:53 | access to property QueryString : NameValueCollection | semmle.label | access to property QueryString : NameValueCollection |
33
+ | UrlRedirect2.cs:14:31:14:61 | access to indexer | semmle.label | access to indexer |
31
34
| UrlRedirect.cs:13:31:13:53 | access to property QueryString : NameValueCollection | semmle.label | access to property QueryString : NameValueCollection |
32
35
| UrlRedirect.cs:13:31:13:61 | access to indexer | semmle.label | access to indexer |
33
36
| UrlRedirect.cs:23:22:23:44 | access to property QueryString : NameValueCollection | semmle.label | access to property QueryString : NameValueCollection |
58
61
| UrlRedirectCore.cs:56:31:56:35 | access to parameter value | semmle.label | access to parameter value |
59
62
subpaths
60
63
#select
64
+ | UrlRedirect2.cs:14:31:14:61 | access to indexer | UrlRedirect2.cs:14:31:14:53 | access to property QueryString : NameValueCollection | UrlRedirect2.cs:14:31:14:61 | access to indexer | Untrusted URL redirection due to $@. | UrlRedirect2.cs:14:31:14:53 | access to property QueryString | user-provided value |
61
65
| UrlRedirect.cs:13:31:13:61 | access to indexer | UrlRedirect.cs:13:31:13:53 | access to property QueryString : NameValueCollection | UrlRedirect.cs:13:31:13:61 | access to indexer | Untrusted URL redirection due to $@. | UrlRedirect.cs:13:31:13:53 | access to property QueryString | user-provided value |
62
66
| UrlRedirect.cs:38:44:38:74 | access to indexer | UrlRedirect.cs:38:44:38:66 | access to property QueryString : NameValueCollection | UrlRedirect.cs:38:44:38:74 | access to indexer | Untrusted URL redirection due to $@. | UrlRedirect.cs:38:44:38:66 | access to property QueryString | user-provided value |
63
67
| UrlRedirect.cs:39:47:39:77 | access to indexer | UrlRedirect.cs:39:47:39:69 | access to property QueryString : NameValueCollection | UrlRedirect.cs:39:47:39:77 | access to indexer | Untrusted URL redirection due to $@. | UrlRedirect.cs:39:47:39:69 | access to property QueryString | user-provided value |
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Web ;
3
+ using System . Web . Mvc ;
4
+ using System . Web . WebPages ;
5
+ using System . Collections . Generic ;
6
+
7
+ public class UrlRedirectHandler2 : IHttpHandler
8
+ {
9
+ private const String VALID_REDIRECT = "http://cwe.mitre.org/data/definitions/601.html" ;
10
+
11
+ public void ProcessRequest ( HttpContext ctx )
12
+ {
13
+ // BAD: a request parameter is incorporated without validation into a URL redirect
14
+ ctx . Response . Redirect ( ctx . Request . QueryString [ "page" ] ) ;
15
+
16
+ List < string > VALID_REDIRECTS = new List < string > { "http://cwe.mitre.org/data/definitions/601.html" , "http://cwe.mitre.org/data/definitions/79.html" } ;
17
+
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments