mirror of
https://github.com/github/codeql.git
synced 2026-01-26 12:52:57 +01:00
25 lines
907 B
Plaintext
25 lines
907 B
Plaintext
/** Provides a taint-tracking configuration to reason about improper validation of user-provided array index. */
|
|
|
|
import java
|
|
private import semmle.code.java.security.internal.ArraySizing
|
|
private import semmle.code.java.dataflow.FlowSources
|
|
|
|
/**
|
|
* A taint-tracking configuration to reason about improper validation of user-provided array index.
|
|
*/
|
|
module ImproperValidationOfArrayIndexConfig implements DataFlow::ConfigSig {
|
|
predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
|
|
|
|
predicate isSink(DataFlow::Node sink) {
|
|
any(CheckableArrayAccess caa).canThrowOutOfBounds(sink.asExpr())
|
|
}
|
|
|
|
predicate isBarrier(DataFlow::Node node) { node.getType() instanceof BooleanType }
|
|
}
|
|
|
|
/**
|
|
* Taint-tracking flow for improper validation of user-provided array index.
|
|
*/
|
|
module ImproperValidationOfArrayIndexFlow =
|
|
TaintTracking::Global<ImproperValidationOfArrayIndexConfig>;
|