Skip to content

Commit 989afb4

Browse files
Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <[email protected]>
1 parent 29490e5 commit 989afb4

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

java/ql/src/semmle/code/java/security/JndiInjectionQuery.qll

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ private class UnsafeSearchControlsSink extends JndiInjectionSink {
4040

4141
/**
4242
* Find flows between a `SearchControls` object with `setReturningObjFlag` = `true`
43-
* and an argument of a `LdapOperations.search` or `DirContext.search` call.
43+
* and an argument of an `LdapOperations.search` or `DirContext.search` call.
4444
*/
4545
private class UnsafeSearchControlsConf extends DataFlow2::Configuration {
4646
UnsafeSearchControlsConf() { this = "UnsafeSearchControlsConf" }
4747

48-
override predicate isSource(DataFlow2::Node source) { source instanceof UnsafeSearchControls }
48+
override predicate isSource(DataFlow::Node source) { source instanceof UnsafeSearchControls }
4949

50-
override predicate isSink(DataFlow2::Node sink) { sink instanceof UnsafeSearchControlsArgument }
50+
override predicate isSink(DataFlow::Node sink) { sink instanceof UnsafeSearchControlsArgument }
5151
}
5252

5353
/**
54-
* An argument of type `SearchControls` of a a `LdapOperations.search` or `DirContext.search` call.
54+
* An argument of type `SearchControls` of an `LdapOperations.search` or `DirContext.search` call.
5555
*/
56-
private class UnsafeSearchControlsArgument extends DataFlow2::ExprNode {
56+
private class UnsafeSearchControlsArgument extends DataFlow::ExprNode {
5757
UnsafeSearchControlsArgument() {
5858
exists(MethodAccess ma, Method m |
5959
ma.getMethod() = m and
@@ -70,7 +70,7 @@ private class UnsafeSearchControlsArgument extends DataFlow2::ExprNode {
7070
/**
7171
* A `SearchControls` object with `setReturningObjFlag` = `true`.
7272
*/
73-
private class UnsafeSearchControls extends DataFlow2::ExprNode {
73+
private class UnsafeSearchControls extends DataFlow::ExprNode {
7474
UnsafeSearchControls() {
7575
exists(MethodAccess ma |
7676
ma.getMethod() instanceof SetReturningObjFlagMethod and
@@ -95,8 +95,3 @@ private class SetReturningObjFlagMethod extends Method {
9595
this.hasName("setReturningObjFlag")
9696
}
9797
}
98-
99-
/** The class `java.util.Hashtable`. */
100-
private class TypeHashtable extends Class {
101-
TypeHashtable() { this.getSourceDeclaration().hasQualifiedName("java.util", "Hashtable") }
102-
}

java/ql/test/query-tests/security/CWE-074/JndiInjectionTest.ql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import java
2-
import semmle.code.java.dataflow.TaintTracking
3-
import semmle.code.java.dataflow.FlowSources
42
import semmle.code.java.security.JndiInjectionQuery
53
import TestUtilities.InlineExpectationsTest
64

0 commit comments

Comments
 (0)