mirror of
https://github.com/github/codeql.git
synced 2026-02-23 18:33:42 +01:00
Move and convert URL redirect sinks
Adds for them as well
This commit is contained in:
@@ -308,6 +308,20 @@ class JaxRSConsumesAnnotation extends JaxRSAnnotation {
|
||||
JaxRSConsumesAnnotation() { this.getType().hasQualifiedName(getAJaxRsPackage(), "Consumes") }
|
||||
}
|
||||
|
||||
/** A URL redirection sink from JAX-RS */
|
||||
private class JaxRsUrlRedirectSink extends SinkModelCsv {
|
||||
override predicate row(string row) {
|
||||
row =
|
||||
[
|
||||
//`namespace; type; subtypes; name; signature; ext; input; kind`
|
||||
"javax.ws.rs.core;Response;true;seeOther;;;Argument[0];url-redirect",
|
||||
"javax.ws.rs.core;Response;true;temporaryRedirect;;;Argument[0];url-redirect",
|
||||
"jakarta.ws.rs.core;Response;true;seeOther;;;Argument[0];url-redirect",
|
||||
"jakarta.ws.rs.core;Response;true;temporaryRedirect;;;Argument[0];url-redirect"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Model Response:
|
||||
*
|
||||
|
||||
@@ -36,17 +36,3 @@ private class ApacheUrlRedirectSink extends UrlRedirectSink {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** A URL redirection sink from JAX-RS */
|
||||
private class JaxRsUrlRedirectSink extends UrlRedirectSink {
|
||||
JaxRsUrlRedirectSink() {
|
||||
exists(MethodAccess ma |
|
||||
ma.getMethod()
|
||||
.getDeclaringType()
|
||||
.getAnAncestor()
|
||||
.hasQualifiedName(getAJaxRsPackage("core"), "Response") and
|
||||
ma.getMethod().getName() in ["seeOther", "temporaryRedirect"] and
|
||||
this.asExpr() = ma.getArgument(0)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user