mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Merge branch 'main' into amammad-java-bombs
This commit is contained in:
@@ -72,7 +72,7 @@ class ArrayInitAtNonZeroIndex extends DataFlow::Node {
|
||||
class StreamConcatAtNonZeroIndex extends DataFlow::Node {
|
||||
StreamConcatAtNonZeroIndex() {
|
||||
exists(MethodCall call, int index |
|
||||
call.getMethod().getQualifiedName() = "java.util.stream.Stream.concat" and
|
||||
call.getMethod().hasQualifiedName("java.util.stream", "Stream", "concat") and
|
||||
call.getArgument(index) = this.asExpr() and
|
||||
index != 0
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
import java
|
||||
import semmle.code.java.security.CommandLineQuery
|
||||
import RemoteUserInputToArgumentToExecFlow::PathGraph
|
||||
import InputToArgumentToExecFlow::PathGraph
|
||||
private import semmle.code.java.dataflow.ExternalFlow
|
||||
|
||||
private class ActivateModels extends ActiveExperimentalModels {
|
||||
@@ -23,8 +23,7 @@ private class ActivateModels extends ActiveExperimentalModels {
|
||||
|
||||
// This is a clone of query `java/command-line-injection` that also includes experimental sinks.
|
||||
from
|
||||
RemoteUserInputToArgumentToExecFlow::PathNode source,
|
||||
RemoteUserInputToArgumentToExecFlow::PathNode sink, Expr execArg
|
||||
InputToArgumentToExecFlow::PathNode source, InputToArgumentToExecFlow::PathNode sink, Expr execArg
|
||||
where execIsTainted(source, sink, execArg)
|
||||
select execArg, source, sink, "This command line depends on a $@.", source.getNode(),
|
||||
"user-provided value"
|
||||
|
||||
@@ -72,8 +72,7 @@ class HostVerificationMethodCall extends MethodCall {
|
||||
exists(MethodCall ma, Method m, Field f |
|
||||
this.getArgument(0) = ma and
|
||||
ma.getMethod() = m and
|
||||
m.hasName("getString") and
|
||||
m.getDeclaringType().getQualifiedName() = "android.content.res.Resources" and
|
||||
m.hasQualifiedName("android.content.res", "Resources", "getString") and
|
||||
ma.getArgument(0).(FieldRead).getField() = f and
|
||||
f.getDeclaringType() instanceof AndroidRString
|
||||
) //Check resource properties in /res/values/strings.xml in Android mobile applications using res.getString(R.string.key)
|
||||
|
||||
Reference in New Issue
Block a user