Skip to content

Commit e4db5f9

Browse files
committed
Python: Model asyncpg.connection.connect()
1 parent 4f91179 commit e4db5f9

File tree

2 files changed

+4
-0
lines changed
  • python/ql

2 files changed

+4
-0
lines changed

python/ql/lib/semmle/python/frameworks/Asyncpg.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ private module Asyncpg {
2222
// * - the result of `asyncpg.connect()` is awaited.
2323
// * - the result of calling `acquire` on a `ConnectionPool` is awaited.
2424
"asyncpg.Connection;asyncpg;Member[connect].ReturnValue.Awaited",
25+
"asyncpg.Connection;asyncpg;Member[connection].Member[connect].ReturnValue.Awaited",
2526
"asyncpg.Connection;asyncpg.ConnectionPool;Member[acquire].ReturnValue.Awaited",
2627
// Creating an internal `~Connection` type that contains both `Connection` and `ConnectionPool`.
2728
"asyncpg.~Connection;asyncpg.Connection;", //

python/ql/test/library-tests/frameworks/asyncpg/test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ async def test_connection():
2222
finally:
2323
await conn.close()
2424

25+
conn = await asyncpg.connection.connect()
26+
conn.execute("sql") # $ mad-sink[sql-injection]="sql"
27+
2528

2629
async def test_prepared_statement():
2730
conn = await asyncpg.connect()

0 commit comments

Comments
 (0)