mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
Join ServletUrlRedirectSink with UrlRedirectSink
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
import java
|
||||
import semmle.code.java.frameworks.Servlets
|
||||
import semmle.code.java.dataflow.DataFlow
|
||||
import semmle.code.java.security.UrlRedirect
|
||||
|
||||
/**
|
||||
* A Servlet URL redirection sink.
|
||||
*/
|
||||
class ServletUrlRedirectSink extends UrlRedirectSink {
|
||||
ServletUrlRedirectSink() {
|
||||
exists(MethodAccess ma |
|
||||
ma.getMethod() instanceof HttpServletResponseSendRedirectMethod and
|
||||
this.asExpr() = ma.getArgument(0)
|
||||
)
|
||||
or
|
||||
exists(MethodAccess ma |
|
||||
ma.getMethod() instanceof ResponseSetHeaderMethod or
|
||||
ma.getMethod() instanceof ResponseAddHeaderMethod
|
||||
|
|
||||
ma.getArgument(0).(CompileTimeConstantExpr).getStringValue() = "Location" and
|
||||
this.asExpr() = ma.getArgument(1)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
import java
|
||||
import semmle.code.java.dataflow.FlowSources
|
||||
import ServletUrlRedirect
|
||||
import semmle.code.java.security.UrlRedirect
|
||||
import DataFlow::PathGraph
|
||||
|
||||
class UrlRedirectConfig extends TaintTracking::Configuration {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
import java
|
||||
import semmle.code.java.dataflow.FlowSources
|
||||
import ServletUrlRedirect
|
||||
import semmle.code.java.security.UrlRedirect
|
||||
import DataFlow::PathGraph
|
||||
|
||||
class UrlRedirectLocalConfig extends TaintTracking::Configuration {
|
||||
|
||||
Reference in New Issue
Block a user