Skip to content

Commit 319923f

Browse files
Add python cx_oracle, phoenixdb, pyodbc models
1 parent 0883b17 commit 319923f

File tree

5 files changed

+108
-0
lines changed

5 files changed

+108
-0
lines changed

docs/codeql/support/reusables/frameworks.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,14 @@ and the CodeQL library pack ``codeql/python-all`` (`changelog <https://github.co
221221
aiopg, Database
222222
asyncpg, Database
223223
clickhouse-driver, Database
224+
cx_Oracle, Database
224225
mysql-connector-python, Database
225226
mysql-connector, Database
226227
MySQL-python, Database
227228
mysqlclient, Database
229+
phoenixdb, Database
228230
psycopg2, Database
231+
pyodbc, Database
229232
sqlite3, Database
230233
Flask-SQLAlchemy, Database ORM
231234
peewee, Database ORM

python/ql/lib/semmle/python/Frameworks.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ private import semmle.python.frameworks.Urllib3
5454
private import semmle.python.frameworks.Yaml
5555
private import semmle.python.frameworks.Yarl
5656
private import semmle.python.frameworks.Xmltodict
57+
private import semmle.python.frameworks.Cx_Oracle
58+
private import semmle.python.frameworks.Phoenixdb
59+
private import semmle.python.frameworks.Pyodbc
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Provides classes modeling security-relevant aspects of the `cx_Oracle` PyPI package.
3+
*
4+
* See
5+
* - https://github.com/oracle/python-cx_Oracle
6+
* - https://pypi.org/project/cx-Oracle/
7+
*/
8+
9+
private import python
10+
private import semmle.python.dataflow.new.DataFlow
11+
private import semmle.python.dataflow.new.RemoteFlowSources
12+
private import semmle.python.Concepts
13+
private import semmle.python.ApiGraphs
14+
private import semmle.python.frameworks.PEP249
15+
16+
/**
17+
* Provides models for the `cx_Oracle` PyPI package.
18+
*
19+
* See
20+
* - https://github.com/oracle/python-cx_Oracle
21+
* - https://pypi.org/project/cx-Oracle/
22+
*/
23+
private module Cx_Oracle {
24+
// ---------------------------------------------------------------------------
25+
// Cx_Oracle
26+
// ---------------------------------------------------------------------------
27+
/**
28+
* A model for Cx_Oracle as a module that implements PEP 249, providing ways to execute SQL statements
29+
* against a database.
30+
*/
31+
class Cx_Oracle extends PEP249::PEP249ModuleApiNode {
32+
Cx_Oracle() { this = API::moduleImport("cx_Oracle") }
33+
}
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Provides classes modeling security-relevant aspects of the `phoenixdb` PyPI package.
3+
*
4+
* See
5+
* - https://github.com/apache/phoenix-queryserver/tree/master/python-phoenixdb
6+
* - https://pypi.org/project/phoenixdb/
7+
*/
8+
9+
private import python
10+
private import semmle.python.dataflow.new.DataFlow
11+
private import semmle.python.dataflow.new.RemoteFlowSources
12+
private import semmle.python.Concepts
13+
private import semmle.python.ApiGraphs
14+
private import semmle.python.frameworks.PEP249
15+
16+
/**
17+
* Provides models for the `phoenixdb` PyPI package.
18+
*
19+
* See
20+
* - https://github.com/apache/phoenix-queryserver/tree/master/python-phoenixdb
21+
* - https://pypi.org/project/phoenixdb/
22+
*/
23+
private module Phoenixdb {
24+
// ---------------------------------------------------------------------------
25+
// Phoenixdb
26+
// ---------------------------------------------------------------------------
27+
/**
28+
* A model for Phoenixdb as a module that implements PEP 249, providing ways to execute SQL statements
29+
* against a database.
30+
*/
31+
class Phoenixdb extends PEP249::PEP249ModuleApiNode {
32+
Phoenixdb() { this = API::moduleImport("phoenixdb") }
33+
}
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Provides classes modeling security-relevant aspects of the `pyodbc` PyPI package.
3+
*
4+
* See
5+
* - https://github.com/mkleehammer/pyodbc/wiki
6+
* - https://pypi.org/project/pyodbc/
7+
*/
8+
9+
private import python
10+
private import semmle.python.dataflow.new.DataFlow
11+
private import semmle.python.dataflow.new.RemoteFlowSources
12+
private import semmle.python.Concepts
13+
private import semmle.python.ApiGraphs
14+
private import semmle.python.frameworks.PEP249
15+
16+
/**
17+
* Provides models for the `pyodbc` PyPI package.
18+
*
19+
* See
20+
* - https://github.com/mkleehammer/pyodbc/wiki
21+
* - https://pypi.org/project/pyodbc/
22+
*/
23+
private module Pyodbc {
24+
// ---------------------------------------------------------------------------
25+
// Pyodbc
26+
// ---------------------------------------------------------------------------
27+
/**
28+
* A model for Pyodbc as a module that implements PEP 249, providing ways to execute SQL statements
29+
* against a database.
30+
*/
31+
class Pyodbc extends PEP249::PEP249ModuleApiNode {
32+
Pyodbc() { this = API::moduleImport("pyodbc") }
33+
}
34+
}

0 commit comments

Comments
 (0)