cobraphp 0.1.0.dev1__tar.gz → 0.1.0.dev3__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.dev1/src/cobraphp.egg-info → cobraphp-0.1.0.dev3}/PKG-INFO +16 -6
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/README.md +14 -4
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/pyproject.toml +2 -2
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/__init__.py +3 -1
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3/src/cobraphp.egg-info}/PKG-INFO +16 -6
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/LICENSE +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/setup.cfg +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/__init__.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/_backend.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/_placeholder.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_ast_types.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_call_builder.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_call_graph.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_call_graph_nodes.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_callee_index.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_defuse_builder.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_errors.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_file_filter.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_project_root.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_records.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_semgrep_runner.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_source_kinds.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_taint_graph.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_taint_propagator.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/_taint_rules.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/frameworks.toml +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/php_ast_types.toml +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/rules/database_taint.yaml +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/analysis/rules/user_input_taint.yaml +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/config.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/entries.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/errors.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/graphs.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/project.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/py.typed +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp/results.py +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp.egg-info/SOURCES.txt +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp.egg-info/dependency_links.txt +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp.egg-info/requires.txt +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/src/cobraphp.egg-info/top_level.txt +0 -0
- {cobraphp-0.1.0.dev1 → cobraphp-0.1.0.dev3}/tests/test_interface.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cobraphp
|
|
3
|
-
Version: 0.1.0.
|
|
4
|
-
Summary: Placeholder for the Python interface of CobraPHP, a static taint analyzer for PHP projects
|
|
3
|
+
Version: 0.1.0.dev3
|
|
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
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
@@ -18,9 +18,9 @@ Python interface of [CobraPHP](https://github.com/jhu-seclab-cobra/CobraPHP), th
|
|
|
18
18
|
|
|
19
19
|
## Status
|
|
20
20
|
|
|
21
|
-
**Placeholder.**
|
|
21
|
+
**Placeholder.** The Python binding is not fully implemented. Interfaces and results may change between versions.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The subpackage `cobraphp.analysis` builds a call graph and a data flow from a PHP project parsed with [php-parser-py](https://pypi.org/project/php-parser-py/). The version is a pre-release. The name follows the pattern `bindings-<language>-<analyzer>`.
|
|
24
24
|
|
|
25
25
|
## Install
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ From a checkout, with [uv](https://docs.astral.sh/uv/):
|
|
|
30
30
|
uv sync
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
`uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools.
|
|
33
|
+
`uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools. Run commands through `uv run` so that the programs the dependencies install are on `PATH`.
|
|
34
34
|
|
|
35
35
|
The planned release wheel will bundle the CobraPHP jar. Which Java runtime it uses is undecided ([open gaps](docs/design.md#open-gaps)). Python 3.11 or later.
|
|
36
36
|
|
|
@@ -75,6 +75,16 @@ for node_id in flow.tainted[USER_INPUT]:
|
|
|
75
75
|
print(node_id, backward_slice(flow, node_id, max_depth=3))
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
Apply the same file exclusions outside `parse_project`:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from cobraphp.analysis import app_file_filter, framework_excluded_dirs
|
|
82
|
+
|
|
83
|
+
framework_dirs = framework_excluded_dirs(root.resolve())
|
|
84
|
+
app_files = [p for p in root.resolve().rglob("*.php")
|
|
85
|
+
if app_file_filter(p) and not any(p.is_relative_to(d) for d in framework_dirs)]
|
|
86
|
+
```
|
|
87
|
+
|
|
78
88
|
Handle a failure:
|
|
79
89
|
|
|
80
90
|
```python
|
|
@@ -98,7 +108,7 @@ python -m pytest
|
|
|
98
108
|
python -m mypy
|
|
99
109
|
```
|
|
100
110
|
|
|
101
|
-
Run them inside the environment, for example as `uv run python -m pytest`. The tests marked `integration` run
|
|
111
|
+
Run them inside the environment, for example as `uv run python -m pytest`. The tests marked `integration` run an external program; `python -m pytest -m "not integration"` skips them.
|
|
102
112
|
|
|
103
113
|
## License
|
|
104
114
|
|
|
@@ -4,9 +4,9 @@ Python interface of [CobraPHP](https://github.com/jhu-seclab-cobra/CobraPHP), th
|
|
|
4
4
|
|
|
5
5
|
## Status
|
|
6
6
|
|
|
7
|
-
**Placeholder.**
|
|
7
|
+
**Placeholder.** The Python binding is not fully implemented. Interfaces and results may change between versions.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The subpackage `cobraphp.analysis` builds a call graph and a data flow from a PHP project parsed with [php-parser-py](https://pypi.org/project/php-parser-py/). The version is a pre-release. The name follows the pattern `bindings-<language>-<analyzer>`.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ From a checkout, with [uv](https://docs.astral.sh/uv/):
|
|
|
16
16
|
uv sync
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
`uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools.
|
|
19
|
+
`uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools. Run commands through `uv run` so that the programs the dependencies install are on `PATH`.
|
|
20
20
|
|
|
21
21
|
The planned release wheel will bundle the CobraPHP jar. Which Java runtime it uses is undecided ([open gaps](docs/design.md#open-gaps)). Python 3.11 or later.
|
|
22
22
|
|
|
@@ -61,6 +61,16 @@ for node_id in flow.tainted[USER_INPUT]:
|
|
|
61
61
|
print(node_id, backward_slice(flow, node_id, max_depth=3))
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
Apply the same file exclusions outside `parse_project`:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from cobraphp.analysis import app_file_filter, framework_excluded_dirs
|
|
68
|
+
|
|
69
|
+
framework_dirs = framework_excluded_dirs(root.resolve())
|
|
70
|
+
app_files = [p for p in root.resolve().rglob("*.php")
|
|
71
|
+
if app_file_filter(p) and not any(p.is_relative_to(d) for d in framework_dirs)]
|
|
72
|
+
```
|
|
73
|
+
|
|
64
74
|
Handle a failure:
|
|
65
75
|
|
|
66
76
|
```python
|
|
@@ -84,7 +94,7 @@ python -m pytest
|
|
|
84
94
|
python -m mypy
|
|
85
95
|
```
|
|
86
96
|
|
|
87
|
-
Run them inside the environment, for example as `uv run python -m pytest`. The tests marked `integration` run
|
|
97
|
+
Run them inside the environment, for example as `uv run python -m pytest`. The tests marked `integration` run an external program; `python -m pytest -m "not integration"` skips them.
|
|
88
98
|
|
|
89
99
|
## License
|
|
90
100
|
|
|
@@ -5,8 +5,8 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "cobraphp"
|
|
8
|
-
version = "0.1.0.
|
|
9
|
-
description = "Placeholder for the Python interface of CobraPHP, a static taint analyzer for PHP projects
|
|
8
|
+
version = "0.1.0.dev3"
|
|
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"]
|
|
@@ -10,7 +10,7 @@ from php_parser_py import AST
|
|
|
10
10
|
|
|
11
11
|
from ._call_builder import CallBuilder
|
|
12
12
|
from ._errors import AnalysisTimeoutError, StaticAnalysisError
|
|
13
|
-
from ._file_filter import make_app_file_filter
|
|
13
|
+
from ._file_filter import app_file_filter, framework_excluded_dirs, make_app_file_filter
|
|
14
14
|
from ._records import DataFlowGraph, backward_slice, call_graph_export, data_flow_graph
|
|
15
15
|
from ._source_kinds import DATABASE, USER_INPUT
|
|
16
16
|
from ._taint_propagator import TaintPropagator
|
|
@@ -53,8 +53,10 @@ __all__ = [
|
|
|
53
53
|
"AnalysisTimeoutError",
|
|
54
54
|
"DataFlowGraph",
|
|
55
55
|
"StaticAnalysisError",
|
|
56
|
+
"app_file_filter",
|
|
56
57
|
"backward_slice",
|
|
57
58
|
"build_call_graph",
|
|
58
59
|
"build_data_flow",
|
|
60
|
+
"framework_excluded_dirs",
|
|
59
61
|
"make_app_file_filter",
|
|
60
62
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cobraphp
|
|
3
|
-
Version: 0.1.0.
|
|
4
|
-
Summary: Placeholder for the Python interface of CobraPHP, a static taint analyzer for PHP projects
|
|
3
|
+
Version: 0.1.0.dev3
|
|
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
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
@@ -18,9 +18,9 @@ Python interface of [CobraPHP](https://github.com/jhu-seclab-cobra/CobraPHP), th
|
|
|
18
18
|
|
|
19
19
|
## Status
|
|
20
20
|
|
|
21
|
-
**Placeholder.**
|
|
21
|
+
**Placeholder.** The Python binding is not fully implemented. Interfaces and results may change between versions.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The subpackage `cobraphp.analysis` builds a call graph and a data flow from a PHP project parsed with [php-parser-py](https://pypi.org/project/php-parser-py/). The version is a pre-release. The name follows the pattern `bindings-<language>-<analyzer>`.
|
|
24
24
|
|
|
25
25
|
## Install
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ From a checkout, with [uv](https://docs.astral.sh/uv/):
|
|
|
30
30
|
uv sync
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
`uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools.
|
|
33
|
+
`uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools. Run commands through `uv run` so that the programs the dependencies install are on `PATH`.
|
|
34
34
|
|
|
35
35
|
The planned release wheel will bundle the CobraPHP jar. Which Java runtime it uses is undecided ([open gaps](docs/design.md#open-gaps)). Python 3.11 or later.
|
|
36
36
|
|
|
@@ -75,6 +75,16 @@ for node_id in flow.tainted[USER_INPUT]:
|
|
|
75
75
|
print(node_id, backward_slice(flow, node_id, max_depth=3))
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
Apply the same file exclusions outside `parse_project`:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from cobraphp.analysis import app_file_filter, framework_excluded_dirs
|
|
82
|
+
|
|
83
|
+
framework_dirs = framework_excluded_dirs(root.resolve())
|
|
84
|
+
app_files = [p for p in root.resolve().rglob("*.php")
|
|
85
|
+
if app_file_filter(p) and not any(p.is_relative_to(d) for d in framework_dirs)]
|
|
86
|
+
```
|
|
87
|
+
|
|
78
88
|
Handle a failure:
|
|
79
89
|
|
|
80
90
|
```python
|
|
@@ -98,7 +108,7 @@ python -m pytest
|
|
|
98
108
|
python -m mypy
|
|
99
109
|
```
|
|
100
110
|
|
|
101
|
-
Run them inside the environment, for example as `uv run python -m pytest`. The tests marked `integration` run
|
|
111
|
+
Run them inside the environment, for example as `uv run python -m pytest`. The tests marked `integration` run an external program; `python -m pytest -m "not integration"` skips them.
|
|
102
112
|
|
|
103
113
|
## License
|
|
104
114
|
|
|
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.dev1 → cobraphp-0.1.0.dev3}/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
|
|
File without changes
|