Skip to content

Commit 0695b2a

Browse files
Removed TaintedSpringRequestBody
1 parent c243f2f commit 0695b2a

File tree

3 files changed

+111
-122
lines changed

3 files changed

+111
-122
lines changed

java/ql/src/experimental/Security/CWE/CWE-094/JexlInjectionLib.qll

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import semmle.code.java.dataflow.TaintTracking
1010
class JexlInjectionConfig extends TaintTracking::Configuration {
1111
JexlInjectionConfig() { this = "JexlInjectionConfig" }
1212

13-
override predicate isSource(DataFlow::Node source) {
14-
source instanceof TaintedSpringRequestBody or
15-
source instanceof RemoteFlowSource
16-
}
13+
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
1714

1815
override predicate isSink(DataFlow::Node sink) { sink instanceof JexlEvaluationSink }
1916

@@ -23,16 +20,6 @@ class JexlInjectionConfig extends TaintTracking::Configuration {
2320
}
2421
}
2522

26-
/**
27-
* A data flow source for parameters that have
28-
* a Spring framework annotation indicating remote user input from servlets.
29-
*/
30-
private class TaintedSpringRequestBody extends DataFlow::Node {
31-
TaintedSpringRequestBody() {
32-
this.asParameter().getAnAnnotation() instanceof SpringServletInputAnnotation
33-
}
34-
}
35-
3623
/**
3724
* A sink for Expresssion Language injection vulnerabilities via Jexl,
3825
* i.e. method calls that run evaluation of a JEXL expression.

java/ql/test/experimental/query-tests/security/CWE-094/Jexl3Injection.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
import org.apache.commons.jexl3.*;
77
import org.springframework.http.HttpStatus;
88
import org.springframework.http.ResponseEntity;
9+
import org.springframework.stereotype.Controller;
910
import org.springframework.web.bind.annotation.PathVariable;
1011
import org.springframework.web.bind.annotation.PostMapping;
1112
import org.springframework.web.bind.annotation.RequestBody;
1213

14+
@Controller
1315
public class Jexl3Injection {
1416

1517
private static void runJexlExpression(String jexlExpr) {

0 commit comments

Comments
 (0)