cobraphp 0.1.0.dev8__tar.gz → 0.1.0.dev10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cobraphp-0.1.0.dev8/src/cobraphp.egg-info → cobraphp-0.1.0.dev10}/PKG-INFO +3 -3
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/pyproject.toml +4 -9
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_call_graph.py +1 -1
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_call_graph_nodes.py +4 -4
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_database_writes.py +1 -1
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_defuse_interproc.py +2 -4
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_taint_graph.py +3 -3
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10/src/cobraphp.egg-info}/PKG-INFO +3 -3
- cobraphp-0.1.0.dev10/src/cobraphp.egg-info/requires.txt +4 -0
- cobraphp-0.1.0.dev8/src/cobraphp.egg-info/requires.txt +0 -4
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/LICENSE +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/README.md +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/setup.cfg +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/__init__.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/_backend.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/_placeholder.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/__init__.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_ast_types.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_call_builder.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_callee_index.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_database_write_reach.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_declarations.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_defuse_assignments.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_defuse_builder.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_defuse_values.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_errors.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_file_filter.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_functions.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_node_order.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_parsing.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_project_root.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_records.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_semgrep_runner.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_source_kinds.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_taint_propagator.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_taint_rules.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/_value_dependency.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/database_writes.toml +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/frameworks.toml +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/php_ast_types.toml +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/rules/database_taint.yaml +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/rules/user_input_taint.yaml +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/config.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/entries.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/errors.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/graphs.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/project.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/py.typed +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/results.py +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp.egg-info/SOURCES.txt +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp.egg-info/dependency_links.txt +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp.egg-info/top_level.txt +0 -0
- {cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/tests/test_interface.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cobraphp
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev10
|
|
4
4
|
Summary: Placeholder for the Python interface of CobraPHP, a static taint analyzer for PHP projects.
|
|
5
5
|
License-Expression: GPL-2.0-only
|
|
6
6
|
Requires-Python: >=3.11.5
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: cpg2py==1.2.
|
|
10
|
-
Requires-Dist: php-parser-py==3.0.
|
|
9
|
+
Requires-Dist: cpg2py==1.2.3
|
|
10
|
+
Requires-Dist: php-parser-py==3.0.3
|
|
11
11
|
Requires-Dist: semgrep==1.85.0
|
|
12
12
|
Requires-Dist: setuptools<82
|
|
13
13
|
Dynamic: license-file
|
|
@@ -5,12 +5,12 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "cobraphp"
|
|
8
|
-
version = "0.1.0.
|
|
8
|
+
version = "0.1.0.dev10"
|
|
9
9
|
description = "Placeholder for the Python interface of CobraPHP, a static taint analyzer for PHP projects."
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
license = "GPL-2.0-only"
|
|
12
12
|
license-files = ["LICENSE"]
|
|
13
|
-
# 3.11.5: php-parser-py 3.0.
|
|
13
|
+
# 3.11.5: php-parser-py 3.0.3 requires it. The interface itself needs only 3.10 (dataclass(slots=True, kw_only=True)
|
|
14
14
|
# and X | Y annotations), and 3.11 is the oldest CPython release that still receives upstream security fixes. The
|
|
15
15
|
# Python floor of JPype is unverified.
|
|
16
16
|
requires-python = ">=3.11.5"
|
|
@@ -20,8 +20,8 @@ requires-python = ">=3.11.5"
|
|
|
20
20
|
# that the graph interface the analysis queries stays the same; Semgrep is pinned so that the expressions its
|
|
21
21
|
# rules match stay the same; Semgrep 1.85 imports `pkg_resources`, which setuptools 82 removes.
|
|
22
22
|
dependencies = [
|
|
23
|
-
"cpg2py==1.2.
|
|
24
|
-
"php-parser-py==3.0.
|
|
23
|
+
"cpg2py==1.2.3",
|
|
24
|
+
"php-parser-py==3.0.3",
|
|
25
25
|
"semgrep==1.85.0",
|
|
26
26
|
"setuptools<82",
|
|
27
27
|
]
|
|
@@ -42,11 +42,6 @@ strict = true
|
|
|
42
42
|
files = ["src", "tests"]
|
|
43
43
|
mypy_path = "src"
|
|
44
44
|
|
|
45
|
-
# cpg2py ships no type information.
|
|
46
|
-
[[tool.mypy.overrides]]
|
|
47
|
-
module = ["cpg2py", "cpg2py.*"]
|
|
48
|
-
ignore_missing_imports = true
|
|
49
|
-
|
|
50
45
|
[tool.pytest.ini_options]
|
|
51
46
|
testpaths = ["tests"]
|
|
52
47
|
pythonpath = ["src"]
|
|
@@ -12,7 +12,7 @@ from ._call_graph_nodes import CallEdge, CallNode, FuncNode, SiteNode
|
|
|
12
12
|
__all__ = ["CallGraph", "CallNode", "FuncNode", "SiteNode", "CallEdge"]
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class CallGraph(AbcGraphQuerier[CallNode, CallEdge]):
|
|
15
|
+
class CallGraph(AbcGraphQuerier[CallNode, CallEdge]):
|
|
16
16
|
"""Call graph tracking function declarations and call sites.
|
|
17
17
|
|
|
18
18
|
Uses cpg2py.Storage backend for directed multigraph representation.
|
|
@@ -9,7 +9,7 @@ from cpg2py import AbcEdgeQuerier, AbcNodeQuerier, Storage
|
|
|
9
9
|
from ._errors import StaticAnalysisError
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class CallNode(AbcNodeQuerier):
|
|
12
|
+
class CallNode(AbcNodeQuerier):
|
|
13
13
|
"""Abstract base for call graph node metadata.
|
|
14
14
|
|
|
15
15
|
Extends AbcNodeQuerier to access call graph node properties
|
|
@@ -161,7 +161,7 @@ class SiteNode(CallNode):
|
|
|
161
161
|
self._storage_ref.set_node_prop(self.node_id, "caller_id", value)
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
class CallEdge(AbcEdgeQuerier):
|
|
164
|
+
class CallEdge(AbcEdgeQuerier):
|
|
165
165
|
"""Storage wrapper for call graph edge (call site to callee).
|
|
166
166
|
|
|
167
167
|
Attributes:
|
|
@@ -187,9 +187,9 @@ class CallEdge(AbcEdgeQuerier): # type: ignore[misc]
|
|
|
187
187
|
@property
|
|
188
188
|
def callsite_node_id(self) -> str:
|
|
189
189
|
"""AST node ID of call expression (alias for from_nid)."""
|
|
190
|
-
return
|
|
190
|
+
return self.from_nid
|
|
191
191
|
|
|
192
192
|
@property
|
|
193
193
|
def callee_node_id(self) -> str:
|
|
194
194
|
"""AST node ID of function declaration (alias for to_nid)."""
|
|
195
|
-
return
|
|
195
|
+
return self.to_nid
|
|
@@ -472,7 +472,7 @@ class _Recognizer:
|
|
|
472
472
|
def _type_name(self, node: Node) -> Node | None:
|
|
473
473
|
for child in self._ast.succ(node):
|
|
474
474
|
if child.node_type in _NAME_TYPES:
|
|
475
|
-
return
|
|
475
|
+
return child
|
|
476
476
|
if child.node_type == "NullableType":
|
|
477
477
|
inner = _first_child(self._ast, child)
|
|
478
478
|
if inner is not None and inner.node_type in _NAME_TYPES:
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import cast
|
|
6
|
-
|
|
7
5
|
from php_parser_py import AST, Node
|
|
8
6
|
|
|
9
7
|
from ._call_graph import CallGraph
|
|
@@ -129,7 +127,7 @@ def _get_arg_expression_id(ast: AST, arg_node_id: str) -> str | None:
|
|
|
129
127
|
children = list(ast.succ(arg_node))
|
|
130
128
|
if not children:
|
|
131
129
|
return None
|
|
132
|
-
return
|
|
130
|
+
return children[0].id
|
|
133
131
|
|
|
134
132
|
|
|
135
133
|
def _get_param_variable_id(ast: AST, param_node_id: str) -> str | None:
|
|
@@ -139,5 +137,5 @@ def _get_param_variable_id(ast: AST, param_node_id: str) -> str | None:
|
|
|
139
137
|
return None
|
|
140
138
|
for child in ast.succ(param_node):
|
|
141
139
|
if child.node_type == "Expr_Variable":
|
|
142
|
-
return
|
|
140
|
+
return child.id
|
|
143
141
|
return None
|
|
@@ -10,7 +10,7 @@ from cpg2py import AbcEdgeQuerier, AbcGraphQuerier, AbcNodeQuerier, Storage
|
|
|
10
10
|
from ._errors import StaticAnalysisError
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class DataFlowNode(AbcNodeQuerier):
|
|
13
|
+
class DataFlowNode(AbcNodeQuerier):
|
|
14
14
|
"""Storage wrapper for dataflow graph node taint metadata."""
|
|
15
15
|
|
|
16
16
|
def __init__(self, storage: Storage, node_id: str) -> None:
|
|
@@ -34,7 +34,7 @@ class DataFlowNode(AbcNodeQuerier): # type: ignore[misc]
|
|
|
34
34
|
return len(self.taints) > 0
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
class DataFlowEdge(AbcEdgeQuerier):
|
|
37
|
+
class DataFlowEdge(AbcEdgeQuerier):
|
|
38
38
|
"""Storage wrapper for dataflow graph edge."""
|
|
39
39
|
|
|
40
40
|
def __init__(self, storage: Storage, f_nid: str, t_nid: str, e_type: str) -> None:
|
|
@@ -42,7 +42,7 @@ class DataFlowEdge(AbcEdgeQuerier): # type: ignore[misc]
|
|
|
42
42
|
self._storage_ref = storage
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
class DataFlowGraph(AbcGraphQuerier[DataFlowNode, DataFlowEdge]):
|
|
45
|
+
class DataFlowGraph(AbcGraphQuerier[DataFlowNode, DataFlowEdge]):
|
|
46
46
|
"""Data flow graph tracking taint propagation via cpg2py Storage."""
|
|
47
47
|
|
|
48
48
|
def __init__(self) -> None:
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cobraphp
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev10
|
|
4
4
|
Summary: Placeholder for the Python interface of CobraPHP, a static taint analyzer for PHP projects.
|
|
5
5
|
License-Expression: GPL-2.0-only
|
|
6
6
|
Requires-Python: >=3.11.5
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
9
|
-
Requires-Dist: cpg2py==1.2.
|
|
10
|
-
Requires-Dist: php-parser-py==3.0.
|
|
9
|
+
Requires-Dist: cpg2py==1.2.3
|
|
10
|
+
Requires-Dist: php-parser-py==3.0.3
|
|
11
11
|
Requires-Dist: semgrep==1.85.0
|
|
12
12
|
Requires-Dist: setuptools<82
|
|
13
13
|
Dynamic: license-file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/rules/database_taint.yaml
RENAMED
|
File without changes
|
{cobraphp-0.1.0.dev8 → cobraphp-0.1.0.dev10}/src/cobraphp/analysis/rules/user_input_taint.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|