Skip to content

Commit b96b665

Browse files
Renaming in java/ql/src/experimental/Security/CWE/CWE-094
1 parent b39a3ab commit b96b665

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

java/ql/src/experimental/Security/CWE/CWE-094/InjectionLib.qll renamed to java/ql/src/experimental/Security/CWE/CWE-094/FlowUtils.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import semmle.code.java.dataflow.FlowSources
55
* Holds if `fromNode` to `toNode` is a dataflow step that returns data from
66
* a bean by calling one of its getters.
77
*/
8-
predicate returnsDataFromBean(DataFlow::Node fromNode, DataFlow::Node toNode) {
8+
predicate hasGetterFlow(DataFlow::Node fromNode, DataFlow::Node toNode) {
99
exists(MethodAccess ma, Method m | ma.getMethod() = m |
1010
m instanceof GetterMethod and
1111
ma.getQualifier() = fromNode.asExpr() and

java/ql/src/experimental/Security/CWE/CWE-094/JakartaExpressionInjection.qhelp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ with sandboxing capabilities such as Apache Commons JEXL or the Spring Expressio
2929
The following example shows how untrusted data is used to build and run an expression
3030
using the JUEL interpreter:
3131
</p>
32-
<sample src="UnsafeExpressionEvaluationWithJUEL.java" />
32+
<sample src="UnsafeExpressionEvaluationWithJuel.java" />
3333

3434
<p>
35-
JUEL does not support to run expressions in a sandbox. To prevent running arbitrary code,
35+
JUEL does not support running expressions in a sandbox. To prevent running arbitrary code,
3636
incoming data has to be checked before including it in an expression. The next example
3737
uses a Regex pattern to check whether a user tries to run an allowed expression or not:
3838
</p>
39-
<sample src="SaferExpressionEvaluationWithJUEL.java" />
39+
<sample src="SaferExpressionEvaluationWithJuel.java" />
4040

4141
</example>
4242

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import java
2-
import InjectionLib
2+
import FlowUtils
33
import semmle.code.java.dataflow.FlowSources
44
import semmle.code.java.dataflow.TaintTracking
55

@@ -16,7 +16,7 @@ class JakartaExpressionInjectionConfig extends TaintTracking::Configuration {
1616

1717
override predicate isAdditionalTaintStep(DataFlow::Node fromNode, DataFlow::Node toNode) {
1818
any(TaintPropagatingCall c).taintFlow(fromNode, toNode) or
19-
returnsDataFromBean(fromNode, toNode)
19+
hasGetterFlow(fromNode, toNode)
2020
}
2121
}
2222

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import java
2-
import InjectionLib
2+
import FlowUtils
33
import semmle.code.java.dataflow.FlowSources
44
import semmle.code.java.dataflow.TaintTracking
55

@@ -17,7 +17,7 @@ class JexlInjectionConfig extends TaintTracking::Configuration {
1717

1818
override predicate isAdditionalTaintStep(DataFlow::Node fromNode, DataFlow::Node toNode) {
1919
any(TaintPropagatingJexlMethodCall c).taintFlow(fromNode, toNode) or
20-
returnsDataFromBean(fromNode, toNode)
20+
hasGetterFlow(fromNode, toNode)
2121
}
2222
}
2323

0 commit comments

Comments
 (0)