Merge tag 'codeql-cli/latest' into auto/sync-main-pr

Compatible with the latest released version of the CodeQL CLI
This commit is contained in:
dilanbhalla
2025-06-11 17:00:14 +00:00
1052 changed files with 28053 additions and 10586 deletions

View File

@@ -1,3 +1,7 @@
## 4.0.9
No user-facing changes.
## 4.0.8
### Minor Analysis Improvements

View File

@@ -0,0 +1,3 @@
## 4.0.9
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 4.0.8
lastReleaseVersion: 4.0.9

View File

@@ -1,5 +1,5 @@
name: codeql/python-all
version: 4.0.8
version: 4.0.9
groups: python
dbscheme: semmlecode.python.dbscheme
extractor: python

View File

@@ -151,4 +151,17 @@ private module Pandas {
override DataFlow::Node getCode() { result = this.getParameter(0, "expr").asSink() }
}
/**
* A Call to `pandas.read_sql` or `pandas.read_sql_query`
* which allows for executing raw SQL queries against a database.
* See https://pandas.pydata.org/docs/reference/api/pandas.read_sql.html
*/
class ReadSqlCall extends SqlExecution::Range, DataFlow::CallCfgNode {
ReadSqlCall() {
this = API::moduleImport("pandas").getMember(["read_sql", "read_sql_query"]).getACall()
}
override DataFlow::Node getSql() { result in [this.getArg(0), this.getArgByName("sql")] }
}
}

View File

@@ -1,3 +1,9 @@
## 1.5.2
### Minor Analysis Improvements
* Added SQL injection models from the `pandas` PyPI package.
## 1.5.1
### Minor Analysis Improvements

View File

@@ -0,0 +1,5 @@
## 1.5.2
### Minor Analysis Improvements
* Added SQL injection models from the `pandas` PyPI package.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.5.1
lastReleaseVersion: 1.5.2

View File

@@ -1,5 +1,5 @@
name: codeql/python-queries
version: 1.5.1
version: 1.5.2
groups:
- python
- queries

View File

@@ -1,5 +1,5 @@
import pandas as pd
import sqlite3
df = pd.DataFrame({'temp_c': [17.0, 25.0]}, index=['Portland', 'Berkeley'])
df.sample().query("query") # $getCode="query"
@@ -55,11 +55,12 @@ df = pd.read_sql_table("filepath", 'postgres:///db_name')
df.query("query") # $getCode="query"
df.eval("query") # $getCode="query"
df = pd.read_sql_query("filepath", 'postgres:///db_name')
connection = sqlite3.connect("pets.db")
df = pd.read_sql_query("sql query", connection) # $getSql="sql query"
df.query("query") # $getCode="query"
df.eval("query") # $getCode="query"
df = pd.read_sql("filepath", 'postgres:///db_name')
df = pd.read_sql("sql query", connection) # $getSql="sql query"
df.query("query") # $getCode="query"
df.eval("query") # $getCode="query"