mirror of
https://github.com/github/codeql.git
synced 2025-12-23 20:26:32 +01:00
C++: Update TlsSettingsMisconfiguration with DataFlow::ConfigSig
This commit is contained in:
@@ -12,14 +12,12 @@
|
|||||||
import cpp
|
import cpp
|
||||||
import semmle.code.cpp.security.boostorg.asio.protocols
|
import semmle.code.cpp.security.boostorg.asio.protocols
|
||||||
|
|
||||||
class ExistsAnyFlowConfig extends DataFlow::Configuration {
|
module ExistsAnyFlowConfig implements DataFlow::ConfigSig {
|
||||||
ExistsAnyFlowConfig() { this = "ExistsAnyFlowConfig" }
|
predicate isSource(DataFlow::Node source) {
|
||||||
|
|
||||||
override predicate isSource(DataFlow::Node source) {
|
|
||||||
exists(BoostorgAsio::SslContextClass c | c.getAContructorCall() = source.asExpr())
|
exists(BoostorgAsio::SslContextClass c | c.getAContructorCall() = source.asExpr())
|
||||||
}
|
}
|
||||||
|
|
||||||
override predicate isSink(DataFlow::Node sink) {
|
predicate isSink(DataFlow::Node sink) {
|
||||||
exists(BoostorgAsio::SslSetOptionsFunction f, FunctionCall fcSetOptions |
|
exists(BoostorgAsio::SslSetOptionsFunction f, FunctionCall fcSetOptions |
|
||||||
f.getACallToThisFunction() = fcSetOptions and
|
f.getACallToThisFunction() = fcSetOptions and
|
||||||
fcSetOptions.getQualifier() = sink.asExpr()
|
fcSetOptions.getQualifier() = sink.asExpr()
|
||||||
@@ -27,10 +25,12 @@ class ExistsAnyFlowConfig extends DataFlow::Configuration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module ExistsAnyFlow = DataFlow::Make<ExistsAnyFlowConfig>;
|
||||||
|
|
||||||
bindingset[flag]
|
bindingset[flag]
|
||||||
predicate isOptionSet(ConstructorCall cc, int flag, FunctionCall fcSetOptions) {
|
predicate isOptionSet(ConstructorCall cc, int flag, FunctionCall fcSetOptions) {
|
||||||
exists(ExistsAnyFlowConfig anyFlowConfig, VariableAccess contextSetOptions |
|
exists(VariableAccess contextSetOptions |
|
||||||
anyFlowConfig.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(contextSetOptions)) and
|
ExistsAnyFlow::hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(contextSetOptions)) and
|
||||||
exists(BoostorgAsio::SslSetOptionsFunction f | f.getACallToThisFunction() = fcSetOptions |
|
exists(BoostorgAsio::SslSetOptionsFunction f | f.getACallToThisFunction() = fcSetOptions |
|
||||||
contextSetOptions = fcSetOptions.getQualifier() and
|
contextSetOptions = fcSetOptions.getQualifier() and
|
||||||
forall(
|
forall(
|
||||||
|
|||||||
Reference in New Issue
Block a user