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
1010class 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.
Original file line number Diff line number Diff line change 66import org .apache .commons .jexl3 .*;
77import org .springframework .http .HttpStatus ;
88import org .springframework .http .ResponseEntity ;
9+ import org .springframework .stereotype .Controller ;
910import org .springframework .web .bind .annotation .PathVariable ;
1011import org .springframework .web .bind .annotation .PostMapping ;
1112import org .springframework .web .bind .annotation .RequestBody ;
1213
14+ @ Controller
1315public class Jexl3Injection {
1416
1517 private static void runJexlExpression (String jexlExpr ) {
You can’t perform that action at this time.
0 commit comments