mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Java: update xss sink kind to html-injection and js-injection
This commit is contained in:
@@ -10,6 +10,6 @@ extensions:
|
||||
extensible: sinkModel
|
||||
data:
|
||||
# Models representing methods susceptible to XSS attacks.
|
||||
- ["android.webkit", "WebView", False, "evaluateJavascript", "", "", "Argument[0]", "xss", "manual"]
|
||||
- ["android.webkit", "WebView", False, "loadData", "", "", "Argument[0]", "xss", "manual"]
|
||||
- ["android.webkit", "WebView", False, "loadDataWithBaseURL", "", "", "Argument[1]", "xss", "manual"]
|
||||
- ["android.webkit", "WebView", False, "evaluateJavascript", "", "", "Argument[0]", "js-injection", "manual"]
|
||||
- ["android.webkit", "WebView", False, "loadData", "", "", "Argument[0]", "html-injection", "manual"]
|
||||
- ["android.webkit", "WebView", False, "loadDataWithBaseURL", "", "", "Argument[1]", "html-injection", "manual"]
|
||||
|
||||
@@ -14,5 +14,5 @@ extensions:
|
||||
pack: codeql/java-all
|
||||
extensible: sinkModel
|
||||
data:
|
||||
- ["jakarta.faces.context", "ResponseStream", True, "write", "", "", "Argument[0]", "xss", "manual"]
|
||||
- ["jakarta.faces.context", "ResponseWriter", True, "write", "", "", "Argument[0]", "xss", "manual"]
|
||||
- ["jakarta.faces.context", "ResponseStream", True, "write", "", "", "Argument[0]", "html-injection", "manual"]
|
||||
- ["jakarta.faces.context", "ResponseWriter", True, "write", "", "", "Argument[0]", "html-injection", "manual"]
|
||||
|
||||
@@ -14,5 +14,5 @@ extensions:
|
||||
pack: codeql/java-all
|
||||
extensible: sinkModel
|
||||
data:
|
||||
- ["javax.faces.context", "ResponseStream", True, "write", "", "", "Argument[0]", "xss", "manual"]
|
||||
- ["javax.faces.context", "ResponseWriter", True, "write", "", "", "Argument[0]", "xss", "manual"]
|
||||
- ["javax.faces.context", "ResponseStream", True, "write", "", "", "Argument[0]", "html-injection", "manual"]
|
||||
- ["javax.faces.context", "ResponseWriter", True, "write", "", "", "Argument[0]", "html-injection", "manual"]
|
||||
|
||||
@@ -3,7 +3,7 @@ extensions:
|
||||
pack: codeql/java-all
|
||||
extensible: sinkModel
|
||||
data:
|
||||
- ["org.apache.hc.core5.http", "HttpEntityContainer", True, "setEntity", "(HttpEntity)", "", "Argument[0]", "xss", "manual"]
|
||||
- ["org.apache.hc.core5.http", "HttpEntityContainer", True, "setEntity", "(HttpEntity)", "", "Argument[0]", "html-injection", "manual"]
|
||||
- ["org.apache.hc.core5.http", "HttpRequest", True, "setUri", "(URI)", "", "Argument[0]", "open-url", "hq-manual"]
|
||||
- ["org.apache.hc.core5.http", "HttpRequestFactory", True, "newHttpRequest", "(String,String)", "", "Argument[1]", "open-url", "hq-manual"]
|
||||
- ["org.apache.hc.core5.http", "HttpRequestFactory", True, "newHttpRequest", "(String,URI)", "", "Argument[1]", "open-url", "hq-manual"]
|
||||
|
||||
@@ -10,7 +10,7 @@ extensions:
|
||||
extensible: sinkModel
|
||||
data:
|
||||
- ["org.apache.http", "HttpRequestFactory", True, "newHttpRequest", "(String,String)", "", "Argument[1]", "open-url", "hq-manual"]
|
||||
- ["org.apache.http", "HttpResponse", True, "setEntity", "(HttpEntity)", "", "Argument[0]", "xss", "manual"]
|
||||
- ["org.apache.http", "HttpResponse", True, "setEntity", "(HttpEntity)", "", "Argument[0]", "html-injection", "manual"]
|
||||
- addsTo:
|
||||
pack: codeql/java-all
|
||||
extensible: summaryModel
|
||||
|
||||
@@ -3,7 +3,7 @@ extensions:
|
||||
pack: codeql/java-all
|
||||
extensible: sinkModel
|
||||
data:
|
||||
- ["org.apache.http.util", "EntityUtils", True, "updateEntity", "(HttpResponse,HttpEntity)", "", "Argument[1]", "xss", "manual"]
|
||||
- ["org.apache.http.util", "EntityUtils", True, "updateEntity", "(HttpResponse,HttpEntity)", "", "Argument[1]", "html-injection", "manual"]
|
||||
- addsTo:
|
||||
pack: codeql/java-all
|
||||
extensible: summaryModel
|
||||
|
||||
@@ -275,11 +275,12 @@ module ModelValidation {
|
||||
not kind =
|
||||
[
|
||||
"open-url", "jndi-injection", "ldap-injection", "sql-injection", "jdbc-url",
|
||||
"log-injection", "mvel-injection", "xpath-injection", "groovy-injection", "xss",
|
||||
"ognl-injection", "intent-redirection", "pending-intents", "url-redirection",
|
||||
"create-file", "read-file", "write-file", "hostname-verification", "response-splitting",
|
||||
"information-leak", "xslt-injection", "jexl-injection", "bean-validation",
|
||||
"template-injection", "fragment-injection", "command-injection"
|
||||
"log-injection", "mvel-injection", "xpath-injection", "groovy-injection",
|
||||
"html-injection", "js-injection", "ognl-injection", "intent-redirection",
|
||||
"pending-intents", "url-redirection", "create-file", "read-file", "write-file",
|
||||
"hostname-verification", "response-splitting", "information-leak", "xslt-injection",
|
||||
"jexl-injection", "bean-validation", "template-injection", "fragment-injection",
|
||||
"command-injection"
|
||||
] and
|
||||
not kind.matches("regex-use%") and
|
||||
not kind.matches("qltest%") and
|
||||
|
||||
@@ -39,7 +39,7 @@ class XssAdditionalTaintStep extends Unit {
|
||||
/** A default sink representing methods susceptible to XSS attacks. */
|
||||
private class DefaultXssSink extends XssSink {
|
||||
DefaultXssSink() {
|
||||
sinkNode(this, "xss")
|
||||
sinkNode(this, ["html-injection", "js-injection"])
|
||||
or
|
||||
exists(MethodAccess ma |
|
||||
ma.getMethod() instanceof WritingMethod and
|
||||
|
||||
Reference in New Issue
Block a user