Skip to content

Commit b37b15c

Browse files
committed
Re-structure imports, add some new comments to tests
1 parent 6e94dc5 commit b37b15c

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

java/ql/src/Security/CWE/CWE-094/JexlInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
*/
1212

1313
import java
14-
import DataFlow::PathGraph
1514
import semmle.code.java.dataflow.FlowSources
1615
import semmle.code.java.security.JexlInjection
16+
import DataFlow::PathGraph
1717

1818
/**
1919
* A taint-tracking configuration for unsafe user input

java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ private module Frameworks {
8080
private import semmle.code.java.security.ResponseSplitting
8181
private import semmle.code.java.security.XSS
8282
private import semmle.code.java.security.LdapInjection
83+
private import semmle.code.java.security.JexlInjection
8384
}
8485

8586
private predicate sourceModelCsv(string row) {

java/ql/test/query-tests/security/CWE-094/SandboxedJexl3.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ private static void runJexlExpressionWithSandbox(String jexlExpr) {
1515
JexlSandbox sandbox = new JexlSandbox(false);
1616
sandbox.white(SandboxedJexl3.class.getCanonicalName());
1717
JexlEngine jexl = new JexlBuilder().sandbox(sandbox).create();
18-
JexlExpression e = jexl.createExpression(jexlExpr);
18+
JexlExpression e = jexl.createExpression(jexlExpr); // Safe
1919
JexlContext jc = new MapContext();
20-
e.evaluate(jc);
20+
e.evaluate(jc); // Safe
2121
}
2222

2323
private static void runJexlExpressionWithUberspectSandbox(String jexlExpr) {
2424
JexlUberspect sandbox = new JexlUberspectSandbox();
2525
JexlEngine jexl = new JexlBuilder().uberspect(sandbox).create();
26-
JexlExpression e = jexl.createExpression(jexlExpr);
26+
JexlExpression e = jexl.createExpression(jexlExpr); // Safe
2727
JexlContext jc = new MapContext();
28-
e.evaluate(jc);
28+
e.evaluate(jc); // Safe
2929
}
3030

3131
private static JexlBuilder STATIC_JEXL_BUILDER;
@@ -39,7 +39,7 @@ private static void runJexlExpressionWithUberspectSandbox(String jexlExpr) {
3939
private static void runJexlExpressionViaJxltEngineWithSandbox(String jexlExpr) {
4040
JexlEngine jexl = STATIC_JEXL_BUILDER.create();
4141
JxltEngine jxlt = jexl.createJxltEngine();
42-
jxlt.createExpression(jexlExpr).evaluate(new MapContext());
42+
jxlt.createExpression(jexlExpr).evaluate(new MapContext()); // Safe
4343
}
4444

4545
private static class JexlUberspectSandbox implements JexlUberspect {

0 commit comments

Comments
 (0)