Skip to content

Commit e652d87

Browse files
committed
Update method name and qldoc
1 parent 1497fba commit e652d87

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

java/ql/src/experimental/Security/CWE/CWE-094/JythonInjection.ql

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class LoadClassMethod extends Method {
5252
* Holds if `ma` is a call to a class-loading method, and `sink` is the byte array
5353
* representing the class to be loaded.
5454
*/
55-
predicate loadClass(MethodAccess ma, Expr sink) {
55+
predicate loadsClass(MethodAccess ma, Expr sink) {
5656
exists(Method m, int i | m = ma.getMethod() |
5757
m instanceof LoadClassMethod and
5858
m.getParameter(i).getType() instanceof Array and // makeClass(java.lang.String name, byte[] data, ...)
@@ -85,17 +85,21 @@ predicate compile(MethodAccess ma, Expr sink) {
8585
class CodeInjectionSink extends DataFlow::ExprNode {
8686
CodeInjectionSink() {
8787
runCode(_, this.getExpr()) or
88-
loadClass(_, this.getExpr()) or
88+
loadsClass(_, this.getExpr()) or
8989
compile(_, this.getExpr())
9090
}
9191

9292
MethodAccess getMethodAccess() {
9393
runCode(result, this.getExpr()) or
94-
loadClass(result, this.getExpr()) or
94+
loadsClass(result, this.getExpr()) or
9595
compile(result, this.getExpr())
9696
}
9797
}
9898

99+
/**
100+
* A taint configuration for tracking flow from `RemoteFlowSource` to a Jython method call
101+
* `CodeInjectionSink` that executes injected code.
102+
*/
99103
class CodeInjectionConfiguration extends TaintTracking::Configuration {
100104
CodeInjectionConfiguration() { this = "CodeInjectionConfiguration" }
101105

0 commit comments

Comments
 (0)