mirror of
https://github.com/github/codeql.git
synced 2026-08-03 00:43:00 +02:00
Flips the Python dataflow trunk from the legacy CFG (semmle/python/Flow.qll) and legacy ESSA SSA (semmle/python/essa/*) to the new shared CFG facade (semmle.python.controlflow.internal.Cfg) and the new SSA adapter (semmle.python.dataflow.new.internal.SsaImpl), both introduced additively in the preceding PRs in this stack. This is the trunk-flip equivalent of the original draft PR #21894 (kept around as documentation), rebased on top of the four preparatory PRs: P1: Remove AstNode.getAFlowNode() and rewrite callers (#21919). P2: Qualify Flow.qll's AST references with Py:: prefix (#21920). P3: Add new shared-CFG-backed control flow graph (#21921). P4: Add new shared-SSA-backed SSA adapter (#21923). The Python dataflow library (semmle/python/dataflow/new/) now imports the new CFG facade and SSA adapter. All CFG-typed predicates (ControlFlowNode, CallNode, BasicBlock, NameNode, AttrNode, ...) are qualified with the Cfg:: prefix; SSA references switch from EssaVariable/EssaDefinition to SsaImpl::Definition/SourceVariable. GuardNode is redesigned to use the new CFG's outcome-node model (isAfterTrue / isAfterFalse) instead of the legacy ConditionBlock + flipped indirection. Only BarrierGuard<...> is preserved as public API. Framework files (Bottle, FastApi, Django, Tornado, Pyramid, Stdlib, ...) are updated to take CFG nodes from the new facade. A handful of dataflow consistency tweaks for the new CFG: - Augmented-assignment targets are treated as both load and store. - 'from X import *' produces uncertain SSA writes for unknown names. - CFG nodes are canonicalised so dataflow does not see equivalent pre/post-order pairs as distinct nodes. Two AST tweaks for the new CFG: - AstNodeImpl: omit PEP 695 type-parameter names from FunctionDefExpr / ClassDefExpr children. - ImportResolution: drop the legacy essa import. Test churn (~175 files): reblessed library- and query-test .expected files reflect slightly different CFG granularity, different toString output, and a handful of true alert deltas in security queries. Verification: all 367 lib + src + consistency-queries compile clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
74 lines
6.3 KiB
Plaintext
74 lines
6.3 KiB
Plaintext
edges
|
|
| tests.py:1:35:1:41 | After ImportMember | tests.py:1:35:1:41 | request | provenance | |
|
|
| tests.py:1:35:1:41 | request | tests.py:12:17:12:23 | request | provenance | |
|
|
| tests.py:1:35:1:41 | request | tests.py:24:9:24:15 | request | provenance | |
|
|
| tests.py:1:35:1:41 | request | tests.py:36:9:36:15 | request | provenance | |
|
|
| tests.py:1:35:1:41 | request | tests.py:48:9:48:15 | request | provenance | |
|
|
| tests.py:1:35:1:41 | request | tests.py:60:9:60:15 | request | provenance | |
|
|
| tests.py:1:35:1:41 | request | tests.py:72:9:72:15 | request | provenance | |
|
|
| tests.py:12:5:12:13 | file_path | tests.py:16:39:16:47 | file_path | provenance | |
|
|
| tests.py:12:17:12:23 | request | tests.py:12:17:12:28 | After Attribute | provenance | AdditionalTaintStep |
|
|
| tests.py:12:17:12:28 | After Attribute | tests.py:12:17:12:49 | After Attribute() | provenance | dict.get |
|
|
| tests.py:12:17:12:49 | After Attribute() | tests.py:12:5:12:13 | file_path | provenance | |
|
|
| tests.py:24:5:24:5 | r | tests.py:28:43:28:43 | r | provenance | |
|
|
| tests.py:24:9:24:15 | request | tests.py:24:9:24:20 | After Attribute | provenance | AdditionalTaintStep |
|
|
| tests.py:24:9:24:20 | After Attribute | tests.py:24:9:24:33 | After Attribute() | provenance | dict.get |
|
|
| tests.py:24:9:24:33 | After Attribute() | tests.py:24:5:24:5 | r | provenance | |
|
|
| tests.py:36:5:36:5 | r | tests.py:40:43:40:43 | r | provenance | |
|
|
| tests.py:36:9:36:15 | request | tests.py:36:9:36:20 | After Attribute | provenance | AdditionalTaintStep |
|
|
| tests.py:36:9:36:20 | After Attribute | tests.py:36:9:36:33 | After Attribute() | provenance | dict.get |
|
|
| tests.py:36:9:36:33 | After Attribute() | tests.py:36:5:36:5 | r | provenance | |
|
|
| tests.py:48:5:48:5 | r | tests.py:52:43:52:43 | r | provenance | |
|
|
| tests.py:48:9:48:15 | request | tests.py:48:9:48:20 | After Attribute | provenance | AdditionalTaintStep |
|
|
| tests.py:48:9:48:20 | After Attribute | tests.py:48:9:48:33 | After Attribute() | provenance | dict.get |
|
|
| tests.py:48:9:48:33 | After Attribute() | tests.py:48:5:48:5 | r | provenance | |
|
|
| tests.py:60:5:60:5 | r | tests.py:64:43:64:43 | r | provenance | |
|
|
| tests.py:60:9:60:15 | request | tests.py:60:9:60:20 | After Attribute | provenance | AdditionalTaintStep |
|
|
| tests.py:60:9:60:20 | After Attribute | tests.py:60:9:60:33 | After Attribute() | provenance | dict.get |
|
|
| tests.py:60:9:60:33 | After Attribute() | tests.py:60:5:60:5 | r | provenance | |
|
|
| tests.py:72:5:72:5 | r | tests.py:76:43:76:43 | r | provenance | |
|
|
| tests.py:72:9:72:15 | request | tests.py:72:9:72:20 | After Attribute | provenance | AdditionalTaintStep |
|
|
| tests.py:72:9:72:20 | After Attribute | tests.py:72:9:72:33 | After Attribute() | provenance | dict.get |
|
|
| tests.py:72:9:72:33 | After Attribute() | tests.py:72:5:72:5 | r | provenance | |
|
|
nodes
|
|
| tests.py:1:35:1:41 | After ImportMember | semmle.label | After ImportMember |
|
|
| tests.py:1:35:1:41 | request | semmle.label | request |
|
|
| tests.py:12:5:12:13 | file_path | semmle.label | file_path |
|
|
| tests.py:12:17:12:23 | request | semmle.label | request |
|
|
| tests.py:12:17:12:28 | After Attribute | semmle.label | After Attribute |
|
|
| tests.py:12:17:12:49 | After Attribute() | semmle.label | After Attribute() |
|
|
| tests.py:16:39:16:47 | file_path | semmle.label | file_path |
|
|
| tests.py:24:5:24:5 | r | semmle.label | r |
|
|
| tests.py:24:9:24:15 | request | semmle.label | request |
|
|
| tests.py:24:9:24:20 | After Attribute | semmle.label | After Attribute |
|
|
| tests.py:24:9:24:33 | After Attribute() | semmle.label | After Attribute() |
|
|
| tests.py:28:43:28:43 | r | semmle.label | r |
|
|
| tests.py:36:5:36:5 | r | semmle.label | r |
|
|
| tests.py:36:9:36:15 | request | semmle.label | request |
|
|
| tests.py:36:9:36:20 | After Attribute | semmle.label | After Attribute |
|
|
| tests.py:36:9:36:33 | After Attribute() | semmle.label | After Attribute() |
|
|
| tests.py:40:43:40:43 | r | semmle.label | r |
|
|
| tests.py:48:5:48:5 | r | semmle.label | r |
|
|
| tests.py:48:9:48:15 | request | semmle.label | request |
|
|
| tests.py:48:9:48:20 | After Attribute | semmle.label | After Attribute |
|
|
| tests.py:48:9:48:33 | After Attribute() | semmle.label | After Attribute() |
|
|
| tests.py:52:43:52:43 | r | semmle.label | r |
|
|
| tests.py:60:5:60:5 | r | semmle.label | r |
|
|
| tests.py:60:9:60:15 | request | semmle.label | request |
|
|
| tests.py:60:9:60:20 | After Attribute | semmle.label | After Attribute |
|
|
| tests.py:60:9:60:33 | After Attribute() | semmle.label | After Attribute() |
|
|
| tests.py:64:43:64:43 | r | semmle.label | r |
|
|
| tests.py:72:5:72:5 | r | semmle.label | r |
|
|
| tests.py:72:9:72:15 | request | semmle.label | request |
|
|
| tests.py:72:9:72:20 | After Attribute | semmle.label | After Attribute |
|
|
| tests.py:72:9:72:33 | After Attribute() | semmle.label | After Attribute() |
|
|
| tests.py:76:43:76:43 | r | semmle.label | r |
|
|
subpaths
|
|
#select
|
|
| tests.py:16:39:16:47 | file_path | tests.py:1:35:1:41 | After ImportMember | tests.py:16:39:16:47 | file_path | This $@ can reach a $@. | tests.py:1:35:1:41 | After ImportMember | user-provided value | tests.py:16:39:16:47 | file_path | costly Unicode normalization operation |
|
|
| tests.py:28:43:28:43 | r | tests.py:1:35:1:41 | After ImportMember | tests.py:28:43:28:43 | r | This $@ can reach a $@. | tests.py:1:35:1:41 | After ImportMember | user-provided value | tests.py:28:43:28:43 | r | costly Unicode normalization operation |
|
|
| tests.py:40:43:40:43 | r | tests.py:1:35:1:41 | After ImportMember | tests.py:40:43:40:43 | r | This $@ can reach a $@. | tests.py:1:35:1:41 | After ImportMember | user-provided value | tests.py:40:43:40:43 | r | costly Unicode normalization operation |
|
|
| tests.py:52:43:52:43 | r | tests.py:1:35:1:41 | After ImportMember | tests.py:52:43:52:43 | r | This $@ can reach a $@. | tests.py:1:35:1:41 | After ImportMember | user-provided value | tests.py:52:43:52:43 | r | costly Unicode normalization operation |
|
|
| tests.py:64:43:64:43 | r | tests.py:1:35:1:41 | After ImportMember | tests.py:64:43:64:43 | r | This $@ can reach a $@. | tests.py:1:35:1:41 | After ImportMember | user-provided value | tests.py:64:43:64:43 | r | costly Unicode normalization operation |
|
|
| tests.py:76:43:76:43 | r | tests.py:1:35:1:41 | After ImportMember | tests.py:76:43:76:43 | r | This $@ can reach a $@. | tests.py:1:35:1:41 | After ImportMember | user-provided value | tests.py:76:43:76:43 | r | costly Unicode normalization operation |
|