File tree Expand file tree Collapse file tree
python/ql/src/Security/CWE-327 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,6 +132,15 @@ class UnspecificSSLContextCreation extends SSLContextCreation, UnspecificContext
132132 }
133133}
134134
135+ class UnspecificSSLDefaultContextCreation extends SSLDefaultContextCreation , ProtocolUnrestriction {
136+ override DataFlow:: CfgNode getContext ( ) { result = this }
137+
138+ // see https://docs.python.org/3/library/ssl.html#ssl.create_default_context
139+ override ProtocolVersion getUnrestriction ( ) {
140+ result in [ "TLSv1" , "TLSv1_1" , "TLSv1_2" , "TLSv1_3" ]
141+ }
142+ }
143+
135144class Ssl extends TlsLibrary {
136145 Ssl ( ) { this = "ssl" }
137146
@@ -167,5 +176,7 @@ class Ssl extends TlsLibrary {
167176 result instanceof ContextSetVersion
168177 or
169178 result instanceof UnspecificSSLContextCreation
179+ or
180+ result instanceof UnspecificSSLDefaultContextCreation
170181 }
171182}
You can’t perform that action at this time.
0 commit comments