Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
57886e1
Moved files from experimental to src/
egregius313 Mar 2, 2023
5ff4fcb
Replace `exists` with `any`
egregius313 Mar 2, 2023
938d953
Refactor getLeftmostOperand method
egregius313 Mar 3, 2023
9275b54
Refactoring the InsecureLdapUrl constructor
egregius313 Mar 7, 2023
3936aea
Split Ldap query file into libraries
egregius313 Mar 9, 2023
98b445c
Convert test to InlineExpectationsTest
egregius313 Mar 9, 2023
05da1dc
Merge concatInsecureLdapString into InsecureLdapUrl constructor
egregius313 Mar 9, 2023
6a0167f
Convert to using the new DataFlow modules
egregius313 Mar 9, 2023
db60c08
Add security severity
egregius313 Mar 9, 2023
0f4709e
Add change note
egregius313 Mar 9, 2023
59ce0d7
Documentation changes
egregius313 Mar 9, 2023
efdfc2d
Change version of PathNode used to appropriate module
egregius313 Mar 9, 2023
752620a
Rename SSL configuration and fix PathGraph
egregius313 Mar 9, 2023
cb58936
Documentation changes
egregius313 Mar 10, 2023
658c54a
Change names of configuration to fit new naming convention
egregius313 Mar 10, 2023
151357d
Make classes/predicates not used outside of query private
egregius313 Mar 17, 2023
24d4859
Import changes
egregius313 Mar 17, 2023
f28f1af
Add `InsecureLdapUrlSink`
egregius313 Mar 17, 2023
0eaf222
Move public classes/predicates to top of library file
egregius313 Mar 17, 2023
43d79dc
Apply docs review suggestions
egregius313 Mar 24, 2023
106e5e7
Docs review suggestion
egregius313 Mar 24, 2023
9bfb13b
Update to the `Global`/`flow*` api
egregius313 Mar 27, 2023
97ec808
Make configuration public
egregius313 Mar 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change names of configuration to fit new naming convention
  • Loading branch information
egregius313 committed Mar 27, 2023
commit 658c54a18f2edf892b9fbcb549d9bdf517c9c4b8
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import semmle.code.java.security.InsecureLdapAuth
/**
* A taint-tracking configuration for `ldap://` URL in LDAP authentication.
*/
private module InsecureUrlFlowConfig implements DataFlow::ConfigSig {
private module InsecureLdapUrlConfig implements DataFlow::ConfigSig {
Comment thread
egregius313 marked this conversation as resolved.
Outdated
predicate isSource(DataFlow::Node src) { src.asExpr() instanceof InsecureLdapUrl }

predicate isSink(DataFlow::Node sink) {
Expand All @@ -29,12 +29,12 @@ private module InsecureUrlFlowConfig implements DataFlow::ConfigSig {
}
}

module InsecureUrlFlowConfiguration = TaintTracking::Make<InsecureUrlFlowConfig>;
module InsecureLdapUrlFlow = TaintTracking::Make<InsecureLdapUrlConfig>;

/**
* A taint-tracking configuration for `simple` basic-authentication in LDAP configuration.
*/
private module BasicAuthFlowConfig implements DataFlow::ConfigSig {
private module BasicAuthConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node src) {
Comment thread Fixed
exists(MethodAccess ma |
isBasicAuthEnv(ma) and ma.getQualifier() = src.(PostUpdateNode).getPreUpdateNode().asExpr()
Comment thread
egregius313 marked this conversation as resolved.
Outdated
Expand All @@ -49,7 +49,7 @@ private module BasicAuthFlowConfig implements DataFlow::ConfigSig {
}
}

module BasicAuthFlowConfiguration = DataFlow::Make<BasicAuthFlowConfig>;
module BasicAuthFlow = DataFlow::Make<BasicAuthConfig>;

/**
* A taint-tracking configuration for `ssl` configuration in LDAP authentication.
Expand All @@ -69,4 +69,4 @@ private module RequiresSslConfig implements DataFlow::ConfigSig {
}
}

module RequiresSslConfiguration = DataFlow::Make<RequiresSslConfig>;
module RequiresSslFlow = DataFlow::Make<RequiresSslConfig>;
10 changes: 5 additions & 5 deletions java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

import java
import semmle.code.java.security.InsecureLdapAuthQuery
import InsecureUrlFlowConfiguration::PathGraph
import InsecureLdapUrlFlow::PathGraph

from InsecureUrlFlowConfiguration::PathNode source, InsecureUrlFlowConfiguration::PathNode sink
from InsecureLdapUrlFlow::PathNode source, InsecureLdapUrlFlow::PathNode sink
where
InsecureUrlFlowConfiguration::hasFlowPath(source, sink) and
BasicAuthFlowConfiguration::hasFlowTo(sink.getNode()) and
not RequiresSslConfiguration::hasFlowTo(sink.getNode())
InsecureLdapUrlFlow::hasFlowPath(source, sink) and
BasicAuthFlow::hasFlowTo(sink.getNode()) and
not RequiresSslFlow::hasFlowTo(sink.getNode())
select sink.getNode(), source, sink, "Insecure LDAP authentication from $@.", source.getNode(),
"LDAP connection string"
Comment thread Fixed
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class InsecureLdapAuthenticationTest extends InlineExpectationsTest {

override predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasInsecureLdapAuth" and
exists(DataFlow::Node sink | InsecureUrlFlowConfiguration::hasFlowTo(sink) |
BasicAuthFlowConfiguration::hasFlowTo(sink) and
not SslFlowConfiguration::hasFlowTo(sink) and
exists(DataFlow::Node sink | InsecureLdapUrlFlow::hasFlowTo(sink) |
BasicAuthFlow::hasFlowTo(sink) and
not RequiresSslFlow::hasFlowTo(sink) and
sink.getLocation() = location and
element = sink.toString() and
value = ""
Expand Down