Skip to content

Commit 3a2a99e

Browse files
committed
Fix 1
1 parent ed0aabe commit 3a2a99e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ it may allow the attacker to run arbitrary code.</p>
1313

1414
<recommendation>
1515
<p>It is generally recommended to avoid using untrusted input in a JShell expression.
16-
If it is not possible,JShell expressions should be run in a sandbox that allows accessing only
16+
If it is not possible, JShell expressions should be run in a sandbox that allows accessing only
1717
explicitly allowed classes.</p>
1818
</recommendation>
1919

@@ -25,7 +25,7 @@ to execute untrusted data.</p>
2525

2626
<references>
2727
<li>
28-
Java 9 jshell tutorial: <a href="https://examples.javacodegeeks.com/core-java/java-9-jshell-tutorial/">JShell introduction</a>
28+
Introduction to JShell: <a href="https://docs.oracle.com/en/java/javase/11/jshell/introduction-jshell.html">Java Shell User’s Guide</a>
2929
</li>
3030
</references>
3131
</qhelp>

java/ql/src/experimental/Security/CWE/CWE-094/JShellInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ class JShellInjectionConfiguration extends TaintTracking::Configuration {
2222

2323
override predicate isSink(DataFlow::Node sink) { sink instanceof JShellInjectionSink }
2424

25-
override predicate isAdditionalTaintStep(DataFlow::Node prod, DataFlow::Node succ) {
25+
override predicate isAdditionalTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
2626
exists(MethodAccess ma |
2727
ma.getMethod().hasName("analyzeCompletion") and
2828
ma.getMethod().getNumberOfParameters() = 1 and
2929
ma.getMethod()
3030
.getDeclaringType()
3131
.getASupertype*()
3232
.hasQualifiedName("jdk.jshell", "SourceCodeAnalysis") and
33-
ma.getArgument(0) = prod.asExpr() and
33+
ma.getArgument(0) = pred.asExpr() and
3434
ma = succ.asExpr()
3535
)
3636
}

0 commit comments

Comments
 (0)