File tree Expand file tree Collapse file tree
csharp/ql/test/query-tests/Security Features/CWE-601/UrlRedirect Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11edges
2+ | UrlRedirect2.cs:14:31:14:53 | access to property QueryString : NameValueCollection | UrlRedirect2.cs:14:31:14:61 | access to indexer | provenance | |
23| UrlRedirect.cs:13:31:13:53 | access to property QueryString : NameValueCollection | UrlRedirect.cs:13:31:13:61 | access to indexer | provenance | |
34| UrlRedirect.cs:23:22:23:44 | access to property QueryString : NameValueCollection | UrlRedirect.cs:23:22:23:52 | access to indexer : String | provenance | |
45| UrlRedirect.cs:23:22:23:44 | access to property QueryString : NameValueCollection | UrlRedirect.cs:48:29:48:31 | access to local variable url | provenance | |
2829| UrlRedirectCore.cs:45:51:45:55 | value : String | UrlRedirectCore.cs:56:31:56:35 | access to parameter value | provenance | |
2930| UrlRedirectCore.cs:53:40:53:44 | access to parameter value : String | UrlRedirectCore.cs:53:32:53:45 | object creation of type Uri | provenance | |
3031nodes
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 |
3134| UrlRedirect.cs:13:31:13:53 | access to property QueryString : NameValueCollection | semmle.label | access to property QueryString : NameValueCollection |
3235| UrlRedirect.cs:13:31:13:61 | access to indexer | semmle.label | access to indexer |
3336| UrlRedirect.cs:23:22:23:44 | access to property QueryString : NameValueCollection | semmle.label | access to property QueryString : NameValueCollection |
5861| UrlRedirectCore.cs:56:31:56:35 | access to parameter value | semmle.label | access to parameter value |
5962subpaths
6063#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 |
6165| 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 |
6266| 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 |
6367| 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