mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Java: Don't pass taint through the format methods of Console
This commit is contained in:
@@ -456,7 +456,8 @@ private predicate taintPreservingArgumentToMethod(Method method) {
|
||||
method.getDeclaringType() instanceof TypeString and
|
||||
method.hasName("join")
|
||||
or
|
||||
method instanceof StringFormatMethod
|
||||
method instanceof StringFormatMethod and
|
||||
not method.getDeclaringType().hasQualifiedName("java.io", "Console")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -649,7 +650,8 @@ private predicate argToQualifierStep(Expr tracked, Expr sink) {
|
||||
*/
|
||||
private predicate taintPreservingArgumentToQualifier(Method method) {
|
||||
method instanceof StringFormatMethod and
|
||||
not method.getDeclaringType() instanceof TypeString
|
||||
not method.getDeclaringType() instanceof TypeString and
|
||||
not method.getDeclaringType().hasQualifiedName("java.io", "Console")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user