mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
add host comparisons as a sanitizer for url-redirect
This commit is contained in:
@@ -26,6 +26,10 @@ public class UrlRedirectHandler2 : IHttpHandler
|
||||
// GOOD: The redirect is to a relative URL
|
||||
ctx.Response.Redirect(url.ToString());
|
||||
}
|
||||
|
||||
|
||||
if (url.Host == "example.org") {
|
||||
// GOOD: The redirect is to a known host
|
||||
ctx.Response.Redirect(url.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user