@@ -43,32 +43,49 @@ class InsecureContextConfiguration extends DataFlow::Configuration {
4343}
4444
4545/**
46- * A connection is created from a context allowing an insecure protocol,
47- * and that protocol has not been restricted appropriately.
46+ * Holds if `conectionCreation` marks the creation of a connetion based on the contex
47+ * found at `contextOrigin` and allowing `insecure_version`.
48+ * `specific` is true iff the context if configured for a specific protocol version rather
49+ * than for a family of protocols.
4850 */
49- predicate unsafe_connection_creation (
50- DataFlow:: Node creation , ProtocolVersion insecure_version , DataFlow:: Node source , boolean specific
51+ predicate unsafe_connection_creation_with_context (
52+ DataFlow:: Node connectionCreation , ProtocolVersion insecure_version , DataFlow:: Node contextOrigin ,
53+ boolean specific
5154) {
5255 // Connection created from a context allowing `insecure_version`.
53- exists ( InsecureContextConfiguration c , ProtocolUnrestriction cc | c .hasFlow ( cc , creation ) |
56+ exists ( InsecureContextConfiguration c , ProtocolUnrestriction co |
57+ c .hasFlow ( co , connectionCreation )
58+ |
5459 insecure_version = c .getTrackedVersion ( ) and
55- source = cc and
60+ contextOrigin = co and
5661 specific = false
5762 )
5863 or
5964 // Connection created from a context specifying `insecure_version`.
6065 exists ( TlsLibrary l , DataFlow:: CfgNode cc |
6166 cc = l .insecure_connection_creation ( insecure_version )
6267 |
63- creation = cc and
64- source = cc and
68+ connectionCreation = cc and
69+ contextOrigin = cc and
6570 specific = true
6671 )
6772}
6873
69- /** A connection is created insecurely without reference to a context. */
70- predicate unsafe_context_creation ( DataFlow:: CallCfgNode call , string insecure_version ) {
74+ /**
75+ * Holds if `conectionCreation` marks the creation of a connetion witout reference to a context
76+ * and allowing `insecure_version`.
77+ * `specific` is true iff the context if configured for a specific protocol version rather
78+ * than for a family of protocols.
79+ */
80+ predicate unsafe_connection_creation_without_context (
81+ DataFlow:: CallCfgNode connectionCreation , string insecure_version
82+ ) {
83+ exists ( TlsLibrary l | connectionCreation = l .insecure_connection_creation ( insecure_version ) )
84+ }
85+
86+ /** Holds if `contextCreation` is creating a context ties to a specific insecure version. */
87+ predicate unsafe_context_creation ( DataFlow:: CallCfgNode contextCreation , string insecure_version ) {
7188 exists ( TlsLibrary l , ContextCreation cc | cc = l .insecure_context_creation ( insecure_version ) |
72- cc = call
89+ contextCreation = cc
7390 )
7491}
0 commit comments