File tree Expand file tree Collapse file tree 3 files changed +111
-122
lines changed
src/experimental/Security/CWE/CWE-094
test/experimental/query-tests/security/CWE-094 Expand file tree Collapse file tree 3 files changed +111
-122
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,7 @@ import semmle.code.java.dataflow.TaintTracking
10
10
class JexlInjectionConfig extends TaintTracking:: Configuration {
11
11
JexlInjectionConfig ( ) { this = "JexlInjectionConfig" }
12
12
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 }
17
14
18
15
override predicate isSink ( DataFlow:: Node sink ) { sink instanceof JexlEvaluationSink }
19
16
@@ -23,16 +20,6 @@ class JexlInjectionConfig extends TaintTracking::Configuration {
23
20
}
24
21
}
25
22
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
-
36
23
/**
37
24
* A sink for Expresssion Language injection vulnerabilities via Jexl,
38
25
* i.e. method calls that run evaluation of a JEXL expression.
Original file line number Diff line number Diff line change 6
6
import org .apache .commons .jexl3 .*;
7
7
import org .springframework .http .HttpStatus ;
8
8
import org .springframework .http .ResponseEntity ;
9
+ import org .springframework .stereotype .Controller ;
9
10
import org .springframework .web .bind .annotation .PathVariable ;
10
11
import org .springframework .web .bind .annotation .PostMapping ;
11
12
import org .springframework .web .bind .annotation .RequestBody ;
12
13
14
+ @ Controller
13
15
public class Jexl3Injection {
14
16
15
17
private static void runJexlExpression (String jexlExpr ) {
You can’t perform that action at this time.
0 commit comments