Skip to content

Commit f1f0f50

Browse files
committed
TaintedEnvironmentVariableQuery docs
1 parent 818c5de commit f1f0f50

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

java/ql/lib/semmle/code/java/security/TaintedEnvironmentVariableQuery.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ private module ProcessBuilderEnvironmentConfig implements DataFlow::ConfigSig {
1818

1919
private module ProcessBuilderEnvironmentFlow = DataFlow::Global<ProcessBuilderEnvironmentConfig>;
2020

21+
/**
22+
* A taint-tracking configuration that tracks flow from unvalidated data to an environment variable for a subprocess.
23+
*/
2124
module ExecTaintedEnvironmentConfig implements DataFlow::ConfigSig {
2225
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelFlowSource }
2326

2427
predicate isSink(DataFlow::Node sink) {
2528
sinkNode(sink, "environment-injection")
2629
or
30+
// sink is an added to a `ProcessBuilder::environment` map.
2731
exists(MapPutCall mpc | mpc.getAnArgument() = sink.asExpr() |
2832
ProcessBuilderEnvironmentFlow::flowToExpr(mpc.getQualifier())
2933
)
3034
}
3135
}
3236

37+
/**
38+
* Taint-tracking flow for unvalidated data to an environment variable for a subprocess.
39+
*/
3340
module ExecTaintedEnvironmentFlow = TaintTracking::Global<ExecTaintedEnvironmentConfig>;

0 commit comments

Comments
 (0)