Skip to content

Commit 78c8577

Browse files
committed
JS: Do not extend AdditionalTaintStep in the ldap library
1 parent a92a701 commit 78c8577

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

javascript/ql/src/experimental/Security/CWE-090/LdapInjection.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,12 @@ module LdapInjection {
1414
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
1515

1616
override predicate isSanitizer(DataFlow::Node node) { node instanceof Sanitizer }
17+
18+
override predicate isAdditionalTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
19+
exists(LdapjsParseFilter filter |
20+
pred = filter.getArgument(0) and
21+
succ = filter
22+
)
23+
}
1724
}
1825
}

javascript/ql/src/experimental/Security/CWE-090/LdapInjectionCustomizations.qll

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
*/
66

77
import javascript
8-
import Ldapjs::Ldapjs
98

109
module LdapInjection {
10+
import Ldapjs::Ldapjs
11+
1112
/**
1213
* A data flow source for LDAP injection vulnerabilities.
1314
*/
@@ -70,16 +71,4 @@ module LdapInjection {
7071
)
7172
}
7273
}
73-
74-
/**
75-
* A step through the parseFilter API (https://github.com/ldapjs/node-ldapjs/issues/181).
76-
*/
77-
class StepThroughParseFilter extends TaintTracking::AdditionalTaintStep, DataFlow::CallNode {
78-
StepThroughParseFilter() { this instanceof LdapjsParseFilter }
79-
80-
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
81-
pred = this.getArgument(0) and
82-
succ = this
83-
}
84-
}
8574
}

0 commit comments

Comments
 (0)