mirror of
https://github.com/github/codeql.git
synced 2026-08-03 17:03:02 +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>
101 lines
10 KiB
Plaintext
101 lines
10 KiB
Plaintext
edges
|
|
| test.py:19:5:19:12 | password | test.py:20:48:20:55 | password | provenance | |
|
|
| test.py:19:5:19:12 | password | test.py:22:58:22:65 | password | provenance | |
|
|
| test.py:19:5:19:12 | password | test.py:23:58:23:65 | password | provenance | |
|
|
| test.py:19:5:19:12 | password | test.py:27:40:27:47 | password | provenance | |
|
|
| test.py:19:5:19:12 | password | test.py:30:58:30:65 | password | provenance | |
|
|
| test.py:19:16:19:29 | After get_password() | test.py:19:5:19:12 | password | provenance | |
|
|
| test.py:44:5:44:5 | x | test.py:45:11:45:11 | x | provenance | |
|
|
| test.py:44:9:44:25 | After Attribute() | test.py:44:5:44:5 | x | provenance | |
|
|
| test.py:48:14:48:35 | social_security_number | test.py:49:15:49:36 | social_security_number | provenance | |
|
|
| test.py:48:38:48:40 | ssn | test.py:50:15:50:17 | ssn | provenance | |
|
|
| test.py:48:54:48:63 | passportNo | test.py:52:15:52:24 | passportNo | provenance | |
|
|
| test.py:54:14:54:22 | post_code | test.py:55:15:55:23 | post_code | provenance | |
|
|
| test.py:54:25:54:31 | zipCode | test.py:56:15:56:21 | zipCode | provenance | |
|
|
| test.py:54:34:54:45 | home_address | test.py:57:15:57:26 | home_address | provenance | |
|
|
| test.py:59:14:59:26 | user_latitude | test.py:60:15:60:27 | user_latitude | provenance | |
|
|
| test.py:59:29:59:42 | user_longitude | test.py:61:15:61:28 | user_longitude | provenance | |
|
|
| test.py:63:14:63:26 | mobile_number | test.py:64:15:64:27 | mobile_number | provenance | |
|
|
| test.py:63:29:63:35 | phoneNo | test.py:65:15:65:21 | phoneNo | provenance | |
|
|
| test.py:67:14:67:23 | creditcard | test.py:68:15:68:24 | creditcard | provenance | |
|
|
| test.py:67:26:67:35 | debit_card | test.py:69:15:69:24 | debit_card | provenance | |
|
|
| test.py:67:38:67:48 | bank_number | test.py:70:15:70:25 | bank_number | provenance | |
|
|
| test.py:67:76:67:78 | ccn | test.py:73:15:73:17 | ccn | provenance | |
|
|
| test.py:67:81:67:88 | user_ccn | test.py:74:15:74:22 | user_ccn | provenance | |
|
|
| test.py:101:5:101:10 | config | test.py:105:11:105:31 | After Subscript | provenance | |
|
|
| test.py:103:21:103:37 | After Attribute | test.py:101:5:101:10 | config | provenance | |
|
|
nodes
|
|
| test.py:19:5:19:12 | password | semmle.label | password |
|
|
| test.py:19:16:19:29 | After get_password() | semmle.label | After get_password() |
|
|
| test.py:20:48:20:55 | password | semmle.label | password |
|
|
| test.py:22:58:22:65 | password | semmle.label | password |
|
|
| test.py:23:58:23:65 | password | semmle.label | password |
|
|
| test.py:27:40:27:47 | password | semmle.label | password |
|
|
| test.py:30:58:30:65 | password | semmle.label | password |
|
|
| test.py:37:11:37:24 | After get_password() | semmle.label | After get_password() |
|
|
| test.py:39:22:39:35 | After get_password() | semmle.label | After get_password() |
|
|
| test.py:40:22:40:35 | After get_password() | semmle.label | After get_password() |
|
|
| test.py:44:5:44:5 | x | semmle.label | x |
|
|
| test.py:44:9:44:25 | After Attribute() | semmle.label | After Attribute() |
|
|
| test.py:45:11:45:11 | x | semmle.label | x |
|
|
| test.py:48:14:48:35 | social_security_number | semmle.label | social_security_number |
|
|
| test.py:48:38:48:40 | ssn | semmle.label | ssn |
|
|
| test.py:48:54:48:63 | passportNo | semmle.label | passportNo |
|
|
| test.py:49:15:49:36 | social_security_number | semmle.label | social_security_number |
|
|
| test.py:50:15:50:17 | ssn | semmle.label | ssn |
|
|
| test.py:52:15:52:24 | passportNo | semmle.label | passportNo |
|
|
| test.py:54:14:54:22 | post_code | semmle.label | post_code |
|
|
| test.py:54:25:54:31 | zipCode | semmle.label | zipCode |
|
|
| test.py:54:34:54:45 | home_address | semmle.label | home_address |
|
|
| test.py:55:15:55:23 | post_code | semmle.label | post_code |
|
|
| test.py:56:15:56:21 | zipCode | semmle.label | zipCode |
|
|
| test.py:57:15:57:26 | home_address | semmle.label | home_address |
|
|
| test.py:59:14:59:26 | user_latitude | semmle.label | user_latitude |
|
|
| test.py:59:29:59:42 | user_longitude | semmle.label | user_longitude |
|
|
| test.py:60:15:60:27 | user_latitude | semmle.label | user_latitude |
|
|
| test.py:61:15:61:28 | user_longitude | semmle.label | user_longitude |
|
|
| test.py:63:14:63:26 | mobile_number | semmle.label | mobile_number |
|
|
| test.py:63:29:63:35 | phoneNo | semmle.label | phoneNo |
|
|
| test.py:64:15:64:27 | mobile_number | semmle.label | mobile_number |
|
|
| test.py:65:15:65:21 | phoneNo | semmle.label | phoneNo |
|
|
| test.py:67:14:67:23 | creditcard | semmle.label | creditcard |
|
|
| test.py:67:26:67:35 | debit_card | semmle.label | debit_card |
|
|
| test.py:67:38:67:48 | bank_number | semmle.label | bank_number |
|
|
| test.py:67:76:67:78 | ccn | semmle.label | ccn |
|
|
| test.py:67:81:67:88 | user_ccn | semmle.label | user_ccn |
|
|
| test.py:68:15:68:24 | creditcard | semmle.label | creditcard |
|
|
| test.py:69:15:69:24 | debit_card | semmle.label | debit_card |
|
|
| test.py:70:15:70:25 | bank_number | semmle.label | bank_number |
|
|
| test.py:73:15:73:17 | ccn | semmle.label | ccn |
|
|
| test.py:74:15:74:22 | user_ccn | semmle.label | user_ccn |
|
|
| test.py:101:5:101:10 | config | semmle.label | config |
|
|
| test.py:103:21:103:37 | After Attribute | semmle.label | After Attribute |
|
|
| test.py:105:11:105:31 | After Subscript | semmle.label | After Subscript |
|
|
subpaths
|
|
#select
|
|
| test.py:20:48:20:55 | password | test.py:19:16:19:29 | After get_password() | test.py:20:48:20:55 | password | This expression logs $@ as clear text. | test.py:19:16:19:29 | After get_password() | sensitive data (password) |
|
|
| test.py:22:58:22:65 | password | test.py:19:16:19:29 | After get_password() | test.py:22:58:22:65 | password | This expression logs $@ as clear text. | test.py:19:16:19:29 | After get_password() | sensitive data (password) |
|
|
| test.py:23:58:23:65 | password | test.py:19:16:19:29 | After get_password() | test.py:23:58:23:65 | password | This expression logs $@ as clear text. | test.py:19:16:19:29 | After get_password() | sensitive data (password) |
|
|
| test.py:27:40:27:47 | password | test.py:19:16:19:29 | After get_password() | test.py:27:40:27:47 | password | This expression logs $@ as clear text. | test.py:19:16:19:29 | After get_password() | sensitive data (password) |
|
|
| test.py:30:58:30:65 | password | test.py:19:16:19:29 | After get_password() | test.py:30:58:30:65 | password | This expression logs $@ as clear text. | test.py:19:16:19:29 | After get_password() | sensitive data (password) |
|
|
| test.py:37:11:37:24 | After get_password() | test.py:37:11:37:24 | After get_password() | test.py:37:11:37:24 | After get_password() | This expression logs $@ as clear text. | test.py:37:11:37:24 | After get_password() | sensitive data (password) |
|
|
| test.py:39:22:39:35 | After get_password() | test.py:39:22:39:35 | After get_password() | test.py:39:22:39:35 | After get_password() | This expression logs $@ as clear text. | test.py:39:22:39:35 | After get_password() | sensitive data (password) |
|
|
| test.py:40:22:40:35 | After get_password() | test.py:40:22:40:35 | After get_password() | test.py:40:22:40:35 | After get_password() | This expression logs $@ as clear text. | test.py:40:22:40:35 | After get_password() | sensitive data (password) |
|
|
| test.py:45:11:45:11 | x | test.py:44:9:44:25 | After Attribute() | test.py:45:11:45:11 | x | This expression logs $@ as clear text. | test.py:44:9:44:25 | After Attribute() | sensitive data (password) |
|
|
| test.py:49:15:49:36 | social_security_number | test.py:48:14:48:35 | social_security_number | test.py:49:15:49:36 | social_security_number | This expression logs $@ as clear text. | test.py:48:14:48:35 | social_security_number | sensitive data (private) |
|
|
| test.py:50:15:50:17 | ssn | test.py:48:38:48:40 | ssn | test.py:50:15:50:17 | ssn | This expression logs $@ as clear text. | test.py:48:38:48:40 | ssn | sensitive data (private) |
|
|
| test.py:52:15:52:24 | passportNo | test.py:48:54:48:63 | passportNo | test.py:52:15:52:24 | passportNo | This expression logs $@ as clear text. | test.py:48:54:48:63 | passportNo | sensitive data (private) |
|
|
| test.py:55:15:55:23 | post_code | test.py:54:14:54:22 | post_code | test.py:55:15:55:23 | post_code | This expression logs $@ as clear text. | test.py:54:14:54:22 | post_code | sensitive data (private) |
|
|
| test.py:56:15:56:21 | zipCode | test.py:54:25:54:31 | zipCode | test.py:56:15:56:21 | zipCode | This expression logs $@ as clear text. | test.py:54:25:54:31 | zipCode | sensitive data (private) |
|
|
| test.py:57:15:57:26 | home_address | test.py:54:34:54:45 | home_address | test.py:57:15:57:26 | home_address | This expression logs $@ as clear text. | test.py:54:34:54:45 | home_address | sensitive data (private) |
|
|
| test.py:60:15:60:27 | user_latitude | test.py:59:14:59:26 | user_latitude | test.py:60:15:60:27 | user_latitude | This expression logs $@ as clear text. | test.py:59:14:59:26 | user_latitude | sensitive data (private) |
|
|
| test.py:61:15:61:28 | user_longitude | test.py:59:29:59:42 | user_longitude | test.py:61:15:61:28 | user_longitude | This expression logs $@ as clear text. | test.py:59:29:59:42 | user_longitude | sensitive data (private) |
|
|
| test.py:64:15:64:27 | mobile_number | test.py:63:14:63:26 | mobile_number | test.py:64:15:64:27 | mobile_number | This expression logs $@ as clear text. | test.py:63:14:63:26 | mobile_number | sensitive data (private) |
|
|
| test.py:65:15:65:21 | phoneNo | test.py:63:29:63:35 | phoneNo | test.py:65:15:65:21 | phoneNo | This expression logs $@ as clear text. | test.py:63:29:63:35 | phoneNo | sensitive data (private) |
|
|
| test.py:68:15:68:24 | creditcard | test.py:67:14:67:23 | creditcard | test.py:68:15:68:24 | creditcard | This expression logs $@ as clear text. | test.py:67:14:67:23 | creditcard | sensitive data (private) |
|
|
| test.py:69:15:69:24 | debit_card | test.py:67:26:67:35 | debit_card | test.py:69:15:69:24 | debit_card | This expression logs $@ as clear text. | test.py:67:26:67:35 | debit_card | sensitive data (private) |
|
|
| test.py:70:15:70:25 | bank_number | test.py:67:38:67:48 | bank_number | test.py:70:15:70:25 | bank_number | This expression logs $@ as clear text. | test.py:67:38:67:48 | bank_number | sensitive data (private) |
|
|
| test.py:73:15:73:17 | ccn | test.py:67:76:67:78 | ccn | test.py:73:15:73:17 | ccn | This expression logs $@ as clear text. | test.py:67:76:67:78 | ccn | sensitive data (private) |
|
|
| test.py:74:15:74:22 | user_ccn | test.py:67:81:67:88 | user_ccn | test.py:74:15:74:22 | user_ccn | This expression logs $@ as clear text. | test.py:67:81:67:88 | user_ccn | sensitive data (private) |
|
|
| test.py:105:11:105:31 | After Subscript | test.py:103:21:103:37 | After Attribute | test.py:105:11:105:31 | After Subscript | This expression logs $@ as clear text. | test.py:103:21:103:37 | After Attribute | sensitive data (password) |
|