Files
codeql/cpp/ql/src/Likely Bugs/Protocols/UseOfDeprecatedHardcodedProtocol.ql
Anders Schack-Mulligen 72415c7c2c C++: Rename references.
2023-03-23 13:06:19 +01:00

27 lines
1.1 KiB
Plaintext

/**
* @name boost::asio Use of deprecated hardcoded Protocol
* @description Using a deprecated hard-coded protocol using the boost::asio library.
* @kind problem
* @problem.severity error
* @security-severity 7.5
* @id cpp/boost/use-of-deprecated-hardcoded-security-protocol
* @tags security
* external/cwe/cwe-327
*/
import cpp
import semmle.code.cpp.security.boostorg.asio.protocols
from Expr protocolSource, Expr protocolSink, ConstructorCall cc
where
BoostorgAsio::SslContextCallFlow::flow(DataFlow::exprNode(protocolSource),
DataFlow::exprNode(protocolSink)) and
not BoostorgAsio::SslContextCallTlsProtocolFlow::flow(DataFlow::exprNode(protocolSource),
DataFlow::exprNode(protocolSink)) and
cc.getArgument(0) = protocolSink and
BoostorgAsio::SslContextCallBannedProtocolFlow::flow(DataFlow::exprNode(protocolSource),
DataFlow::exprNode(protocolSink))
select protocolSink, "Usage of $@ specifying a deprecated hardcoded protocol $@ in function $@.",
cc, "boost::asio::ssl::context::context", protocolSource, protocolSource.toString(),
cc.getEnclosingFunction(), cc.getEnclosingFunction().toString()