Merge branch 'main' into amammad-java-bombs

This commit is contained in:
Owen Mansel-Chan
2024-07-18 21:28:23 +01:00
committed by GitHub
2888 changed files with 121408 additions and 94224 deletions

View File

@@ -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
)

View File

@@ -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"

View File

@@ -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)