File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
python/ql/src/semmle/python Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,6 @@ private import semmle.python.frameworks.Flask
9
9
private import semmle.python.frameworks.Invoke
10
10
private import semmle.python.frameworks.MySQLdb
11
11
private import semmle.python.frameworks.MysqlConnectorPython
12
+ private import semmle.python.frameworks.Psycopg2
12
13
private import semmle.python.frameworks.Stdlib
13
14
private import semmle.python.frameworks.Yaml
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Provides classes modeling security-relevant aspects of the `psycopg2` PyPI package.
3
+ * See
4
+ * - https://www.psycopg.org/docs/
5
+ * - https://pypi.org/project/psycopg2/
6
+ */
7
+
8
+ private import python
9
+ private import semmle.python.dataflow.new.DataFlow
10
+ private import semmle.python.dataflow.new.RemoteFlowSources
11
+ private import semmle.python.Concepts
12
+ private import PEP249
13
+
14
+ /**
15
+ * Provides models for the `psycopg2` PyPI package.
16
+ * See
17
+ * - https://www.psycopg.org/docs/
18
+ * - https://pypi.org/project/psycopg2/
19
+ */
20
+ module Psycopg2 {
21
+ // ---------------------------------------------------------------------------
22
+ // Psycopg
23
+ // ---------------------------------------------------------------------------
24
+ /** Gets a reference to the `psycopg2` module. */
25
+ private DataFlow:: Node psycopg2 ( DataFlow:: TypeTracker t ) {
26
+ t .start ( ) and
27
+ result = DataFlow:: importNode ( "psycopg2" )
28
+ or
29
+ exists ( DataFlow:: TypeTracker t2 | result = psycopg2 ( t2 ) .track ( t2 , t ) )
30
+ }
31
+
32
+ /** Gets a reference to the `psycopg2` module. */
33
+ DataFlow:: Node psycopg2 ( ) { result = psycopg2 ( DataFlow:: TypeTracker:: end ( ) ) }
34
+
35
+ /** psycopg2 implements PEP 249, providing ways to execute SQL statements against a database. */
36
+ class Psycopg2 extends PEP249Module {
37
+ Psycopg2 ( ) { this = psycopg2 ( ) }
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments