Skip to content

Commit dc6d3fe

Browse files
committed
Use flowFrom.
1 parent 4191b18 commit dc6d3fe

File tree

23 files changed

+26
-34
lines changed

23 files changed

+26
-34
lines changed

cpp/ql/src/Security/CWE/CWE-311/CleartextTransmission.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ module FromSensitiveFlow = TaintTracking::Global<FromSensitiveConfig>;
263263
* A taint flow configuration for flow from a sensitive expression to an encryption operation.
264264
*/
265265
module ToEncryptionConfig implements DataFlow::ConfigSig {
266-
predicate isSource(DataFlow::Node source) { FromSensitiveFlow::flow(source, _) }
266+
predicate isSource(DataFlow::Node source) { FromSensitiveFlow::flowFrom(source) }
267267

268268
predicate isSink(DataFlow::Node sink) { isSinkEncrypt(sink, _) }
269269

@@ -311,7 +311,7 @@ where
311311
FromSensitiveFlow::flowPath(source, sink) and
312312
isSinkSendRecv(sink.getNode(), networkSendRecv) and
313313
// no flow from sensitive -> evidence of encryption
314-
not ToEncryptionFlow::flow(source.getNode(), _) and
314+
not ToEncryptionFlow::flowFrom(source.getNode()) and
315315
not FromEncryptionFlow::flowTo(sink.getNode()) and
316316
// construct result
317317
if networkSendRecv instanceof NetworkSend

cpp/ql/src/experimental/Security/CWE/CWE-193/ConstantSizeArrayOffByOne.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ module PointerArithmeticToDerefFlow = DataFlow::Global<PointerArithmeticToDerefC
129129

130130
predicate pointerArithOverflow(PointerArithmeticInstruction pai, int delta) {
131131
pointerArithOverflow0(pai, delta) and
132-
PointerArithmeticToDerefFlow::flow(DataFlow::instructionNode(pai), _)
132+
PointerArithmeticToDerefFlow::flowFrom(DataFlow::instructionNode(pai))
133133
}
134134

135135
bindingset[v]

csharp/ql/lib/semmle/code/csharp/frameworks/Sql.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class IDbCommandConstructionSqlExpr extends SqlExpr, ObjectCreation {
5252
class DapperCommandDefinitionMethodCallSqlExpr extends SqlExpr, ObjectCreation {
5353
DapperCommandDefinitionMethodCallSqlExpr() {
5454
this.getObjectType() instanceof Dapper::CommandDefinitionStruct and
55-
DapperCommandDefinitionMethodCallSql::flow(DataFlow::exprNode(this), _)
55+
DapperCommandDefinitionMethodCallSql::flowFromExpr(this)
5656
}
5757

5858
override Expr getSql() { result = this.getArgumentForName("commandText") }

csharp/ql/src/Security Features/CWE-614/CookieWithoutSecure.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ predicate insecureCookieOptionsCreation(ObjectCreation oc) {
4646
// `Secure` property in `CookieOptions` passed to IResponseCookies.Append(...) wasn't set
4747
oc.getType() instanceof MicrosoftAspNetCoreHttpCookieOptions and
4848
secureFalseOrNotSet(oc) and
49-
exists(DataFlow::Node creation |
50-
CookieOptionsTracking::flow(creation, _) and
51-
creation.asExpr() = oc
52-
)
49+
CookieOptionsTracking::flowFromExpr(oc)
5350
}
5451

5552
predicate insecureCookieAppend(Expr sink) {

go/ql/lib/semmle/go/security/MissingJwtSignatureCheck.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module MissingJwtSignatureCheck {
1515
module Config implements DataFlow::ConfigSig {
1616
predicate isSource(DataFlow::Node source) {
1717
source instanceof Source and
18-
not SafeParse::flow(source, _)
18+
not SafeParse::flowFrom(source)
1919
}
2020

2121
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }

go/ql/lib/semmle/go/security/UnsafeUnzipSymlink.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module UnsafeUnzipSymlink {
3232
* Holds if `node` is an archive header field read that flows to a `path/filepath.EvalSymlinks` call.
3333
*/
3434
private predicate symlinksEvald(DataFlow::Node node) {
35-
EvalSymlinksFlow::flow(getASimilarReadNode(node), _)
35+
EvalSymlinksFlow::flowFrom(getASimilarReadNode(node))
3636
}
3737

3838
private module Config implements DataFlow::ConfigSig {

go/ql/src/Security/CWE-020/MissingRegexpAnchor.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ module Config implements DataFlow::ConfigSig {
8181
module Flow = DataFlow::Global<Config>;
8282

8383
from DataFlow::Node source, string msg
84-
where Flow::flow(source, _) and Config::isSourceString(source, msg)
84+
where Flow::flowFrom(source) and Config::isSourceString(source, msg)
8585
select source, msg

go/ql/src/Security/CWE-352/ConstantOauth2State.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ module FlowToPrintFlow = DataFlow::Global<FlowToPrintConfig>;
154154

155155
/** Holds if the provided `CallNode`'s result flows to an argument of a printer call. */
156156
predicate resultFlowsToPrinter(DataFlow::CallNode authCodeUrlCall) {
157-
FlowToPrintFlow::flow(authCodeUrlCall.getResult(), _)
157+
FlowToPrintFlow::flowFrom(authCodeUrlCall.getResult())
158158
}
159159

160160
/** Get a data-flow node that reads the value of `os.Stdin`. */

go/ql/src/experimental/CWE-285/PamAuthBypass.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,6 @@ module PamStartToAuthenticateFlow = TaintTracking::Global<PamStartToAuthenticate
7070
from DataFlow::Node source, DataFlow::Node sink
7171
where
7272
not isInTestFile(source.asExpr()) and
73-
(PamStartToAuthenticateFlow::flow(source, sink) and not PamStartToAcctMgmtFlow::flow(source, _))
73+
PamStartToAuthenticateFlow::flow(source, sink) and
74+
not PamStartToAcctMgmtFlow::flowFrom(source)
7475
select source, "This Pam transaction may not be secure."

go/ql/src/experimental/CWE-321-V2/HardCodedKeys.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module JwtParseWithConstantKeyConfig implements DataFlow::ConfigSig {
2424
or
2525
n = fd.(FuncDecl).getFunction().getARead()
2626
|
27-
GolangJwtKeyFunc::flow(n, _) and
27+
GolangJwtKeyFunc::flowFrom(n) and
2828
sink = rn and
2929
rn.getRoot() = fd and
3030
rn.getIndex() = 0

0 commit comments

Comments
 (0)