mirror of
https://github.com/github/codeql.git
synced 2026-03-01 05:13:41 +01:00
Join ServletUrlRedirectSink with UrlRedirectSink
This commit is contained in:
@@ -1,5 +1,24 @@
|
||||
import java
|
||||
import semmle.code.java.dataflow.DataFlow
|
||||
import semmle.code.java.frameworks.Servlets
|
||||
|
||||
/** A URL redirection sink */
|
||||
abstract class UrlRedirectSink extends DataFlow::Node { }
|
||||
|
||||
/** 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)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user