cobraphp 0.1.0.dev6__tar.gz → 0.1.0.dev8__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.
Files changed (52) hide show
  1. {cobraphp-0.1.0.dev6/src/cobraphp.egg-info → cobraphp-0.1.0.dev8}/PKG-INFO +4 -4
  2. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/README.md +1 -1
  3. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/pyproject.toml +6 -5
  4. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_call_builder.py +2 -2
  5. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_callee_index.py +2 -2
  6. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_declarations.py +1 -1
  7. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_defuse_builder.py +3 -3
  8. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_parsing.py +5 -3
  9. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/frameworks.toml +8 -0
  10. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8/src/cobraphp.egg-info}/PKG-INFO +4 -4
  11. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp.egg-info/requires.txt +1 -1
  12. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/LICENSE +0 -0
  13. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/setup.cfg +0 -0
  14. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/__init__.py +0 -0
  15. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/_backend.py +0 -0
  16. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/_placeholder.py +0 -0
  17. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/__init__.py +0 -0
  18. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_ast_types.py +0 -0
  19. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_call_graph.py +0 -0
  20. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_call_graph_nodes.py +0 -0
  21. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_database_write_reach.py +0 -0
  22. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_database_writes.py +0 -0
  23. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_defuse_assignments.py +0 -0
  24. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_defuse_interproc.py +0 -0
  25. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_defuse_values.py +0 -0
  26. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_errors.py +0 -0
  27. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_file_filter.py +0 -0
  28. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_functions.py +0 -0
  29. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_node_order.py +0 -0
  30. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_project_root.py +0 -0
  31. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_records.py +0 -0
  32. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_semgrep_runner.py +0 -0
  33. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_source_kinds.py +0 -0
  34. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_taint_graph.py +0 -0
  35. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_taint_propagator.py +0 -0
  36. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_taint_rules.py +0 -0
  37. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/_value_dependency.py +0 -0
  38. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/database_writes.toml +0 -0
  39. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/php_ast_types.toml +0 -0
  40. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/rules/database_taint.yaml +0 -0
  41. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/analysis/rules/user_input_taint.yaml +0 -0
  42. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/config.py +0 -0
  43. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/entries.py +0 -0
  44. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/errors.py +0 -0
  45. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/graphs.py +0 -0
  46. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/project.py +0 -0
  47. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/py.typed +0 -0
  48. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp/results.py +0 -0
  49. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp.egg-info/SOURCES.txt +0 -0
  50. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp.egg-info/dependency_links.txt +0 -0
  51. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/src/cobraphp.egg-info/top_level.txt +0 -0
  52. {cobraphp-0.1.0.dev6 → cobraphp-0.1.0.dev8}/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.dev6
3
+ Version: 0.1.0.dev8
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
- Requires-Python: >=3.11
6
+ Requires-Python: >=3.11.5
7
7
  Description-Content-Type: text/markdown
8
8
  License-File: LICENSE
9
9
  Requires-Dist: cpg2py==1.2.2
10
- Requires-Dist: php-parser-py==2.1.0
10
+ Requires-Dist: php-parser-py==3.0.1
11
11
  Requires-Dist: semgrep==1.85.0
12
12
  Requires-Dist: setuptools<82
13
13
  Dynamic: license-file
@@ -32,7 +32,7 @@ uv sync
32
32
 
33
33
  `uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools. The analysis starts the `semgrep` program of the scripts directory of the running Python environment, and the first one on `PATH` only when that directory lacks it, so the caller's `PATH` need not hold that directory.
34
34
 
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.
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.5 or later.
36
36
 
37
37
  ## Examples
38
38
 
@@ -18,7 +18,7 @@ uv sync
18
18
 
19
19
  `uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools. The analysis starts the `semgrep` program of the scripts directory of the running Python environment, and the first one on `PATH` only when that directory lacks it, so the caller's `PATH` need not hold that directory.
20
20
 
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.
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.5 or later.
22
22
 
23
23
  ## Examples
24
24
 
@@ -5,14 +5,15 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "cobraphp"
8
- version = "0.1.0.dev6"
8
+ version = "0.1.0.dev8"
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: the interface uses dataclass(slots=True, kw_only=True) and X | Y annotations (3.10 features); 3.11 is the
14
- # oldest CPython release that still receives upstream security fixes. The Python floor of JPype is unverified.
15
- requires-python = ">=3.11"
13
+ # 3.11.5: php-parser-py 3.0.1 requires it. The interface itself needs only 3.10 (dataclass(slots=True, kw_only=True)
14
+ # and X | Y annotations), and 3.11 is the oldest CPython release that still receives upstream security fixes. The
15
+ # Python floor of JPype is unverified.
16
+ requires-python = ">=3.11.5"
16
17
  # Planned runtime dependency of the jar interface, not declared until that implementation exists: JPype1
17
18
  # (in-process JVM bridge). The others are those of `cobraphp.analysis`. php-parser-py is pinned so that the
18
19
  # AST of every target PHP version, 5.6 included, stays the one the analysis is tested on; cpg2py is pinned so
@@ -20,7 +21,7 @@ requires-python = ">=3.11"
20
21
  # rules match stay the same; Semgrep 1.85 imports `pkg_resources`, which setuptools 82 removes.
21
22
  dependencies = [
22
23
  "cpg2py==1.2.2",
23
- "php-parser-py==2.1.0",
24
+ "php-parser-py==3.0.1",
24
25
  "semgrep==1.85.0",
25
26
  "setuptools<82",
26
27
  ]
@@ -80,10 +80,10 @@ class CallBuilder:
80
80
 
81
81
  if callable_node.node_type in NAMED_CALLABLE_TYPES:
82
82
  if len(identifier_children) >= 2:
83
- return str(identifier_children[1].all_properties.get("name", ""))
83
+ return str(identifier_children[1].properties.get("name", ""))
84
84
  elif callable_node.node_type in (CLOSURE_TYPE, ARROW_FUNCTION_TYPE):
85
85
  if len(identifier_children) >= 1:
86
- return str(identifier_children[0].all_properties.get("name", ""))
86
+ return str(identifier_children[0].properties.get("name", ""))
87
87
  return ""
88
88
 
89
89
  def _build_call_sites(self, call_graph: CallGraph, callee_index: CalleeIndex) -> None:
@@ -85,7 +85,7 @@ class CalleeIndex:
85
85
  # Class a method call's receiver (its first child) statically denotes, or None.
86
86
  def _receiver_class_name(self, call_site: Node) -> str | None:
87
87
  receiver = next(iter(self._ast.succ(call_site)))
88
- name = str(receiver.all_properties.get("name", ""))
88
+ name = str(receiver.properties.get("name", ""))
89
89
  if receiver.node_type == _VARIABLE_TYPE:
90
90
  return _enclosing_class_name(self._ast, call_site) if name == _THIS_VARIABLE else None
91
91
  if receiver.node_type not in _NAME_TYPES or name.lower() == "parent":
@@ -108,7 +108,7 @@ def _child_name(ast: AST, node: Node, child_types: frozenset[str]) -> str | None
108
108
  child = next((c for c in ast.succ(node) if c.node_type in child_types), None)
109
109
  if child is None:
110
110
  return None
111
- name = child.all_properties.get("name", "")
111
+ name = child.properties.get("name", "")
112
112
  return str(name) if name else None
113
113
 
114
114
 
@@ -21,7 +21,7 @@ def callable_name(ast: AST, node: Node) -> str:
21
21
  identifier = next((child for child in ast.succ(node) if child.node_type == "Identifier"), None)
22
22
  if identifier is None:
23
23
  raise StaticAnalysisError(f"Callable node {node.id} missing Identifier child for name")
24
- name = identifier.all_properties.get("name", "")
24
+ name = identifier.properties.get("name", "")
25
25
  if not name:
26
26
  raise StaticAnalysisError(f"Callable {node.id} Identifier missing 'name' property")
27
27
  return str(name)
@@ -75,7 +75,7 @@ def _extract_param_defs(ast: AST, func_node: Node) -> dict[str, str]:
75
75
  for param_child in ast.succ(child):
76
76
  if param_child.node_type != "Expr_Variable":
77
77
  continue
78
- var_name = param_child.all_properties.get("name", "")
78
+ var_name = param_child.properties.get("name", "")
79
79
  if var_name:
80
80
  param_defs[cast(str, var_name)] = param_child.id
81
81
  return param_defs
@@ -185,7 +185,7 @@ def _assignment_target(ast: AST, node: Node) -> tuple[str, Node, Node] | None:
185
185
  if parts is None or parts[0].node_type != "Expr_Variable":
186
186
  return None
187
187
  lhs, rhs = parts
188
- var_name = cast(str, lhs.all_properties.get("name", ""))
188
+ var_name = cast(str, lhs.properties.get("name", ""))
189
189
  if not var_name:
190
190
  return None
191
191
  return var_name, lhs, rhs
@@ -237,7 +237,7 @@ def _use_scan_children(
237
237
  return _closure_use_children(ast, node)
238
238
 
239
239
  if node.node_type == "Expr_Variable" and node.id not in lhs_ids:
240
- var_name = node.all_properties.get("name", "")
240
+ var_name = node.properties.get("name", "")
241
241
  # Skip superglobals — they are sources, not def-use targets
242
242
  if var_name and not str(var_name).startswith("_"):
243
243
  result.append((node.id, cast(str, var_name)))
@@ -6,8 +6,7 @@ import re
6
6
  from collections.abc import Callable
7
7
  from pathlib import Path
8
8
 
9
- from php_parser_py import AST, PHPVersion, RunnerError
10
- from php_parser_py import parse_project as _parse_project
9
+ from php_parser_py import AST, Parser, PHPVersion, RunnerError
11
10
 
12
11
  from ._errors import StaticAnalysisError
13
12
 
@@ -31,7 +30,10 @@ def parse_project(
31
30
  if not isinstance(project_path, (str, Path)) or (file_filter is not None and not callable(file_filter)):
32
31
  raise StaticAnalysisError("Invalid project path or file filter")
33
32
  try:
34
- return _parse_project(str(project_path), target_php=version, file_filter=file_filter)
33
+ parser = Parser(target_php=version)
34
+ if file_filter is None:
35
+ return parser.parse_project(str(project_path))
36
+ return parser.parse_project(str(project_path), file_filter=file_filter)
35
37
  except (OSError, ValueError, TypeError, RuntimeError, RunnerError) as exc:
36
38
  raise StaticAnalysisError(f"Failed to parse project: {exc}") from exc
37
39
 
@@ -36,3 +36,11 @@ name = "thinkphp"
36
36
  marker = "thinkphp/base.php"
37
37
  contains = "namespace think;"
38
38
  exclude_subpaths = ["runtime/cache"]
39
+
40
+ # CodeIgniter 3 writes generated PHP-guarded log records in application/logs.
41
+ # Keep application controllers and framework source under this root eligible.
42
+ [[framework]]
43
+ name = "codeigniter3"
44
+ marker = "system/core/CodeIgniter.php"
45
+ contains = "const CI_VERSION = '3."
46
+ exclude_subpaths = ["application/logs"]
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cobraphp
3
- Version: 0.1.0.dev6
3
+ Version: 0.1.0.dev8
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
- Requires-Python: >=3.11
6
+ Requires-Python: >=3.11.5
7
7
  Description-Content-Type: text/markdown
8
8
  License-File: LICENSE
9
9
  Requires-Dist: cpg2py==1.2.2
10
- Requires-Dist: php-parser-py==2.1.0
10
+ Requires-Dist: php-parser-py==3.0.1
11
11
  Requires-Dist: semgrep==1.85.0
12
12
  Requires-Dist: setuptools<82
13
13
  Dynamic: license-file
@@ -32,7 +32,7 @@ uv sync
32
32
 
33
33
  `uv sync` installs the package, its dependencies at the versions of `uv.lock` and the check tools. The analysis starts the `semgrep` program of the scripts directory of the running Python environment, and the first one on `PATH` only when that directory lacks it, so the caller's `PATH` need not hold that directory.
34
34
 
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.
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.5 or later.
36
36
 
37
37
  ## Examples
38
38
 
@@ -1,4 +1,4 @@
1
1
  cpg2py==1.2.2
2
- php-parser-py==2.1.0
2
+ php-parser-py==3.0.1
3
3
  semgrep==1.85.0
4
4
  setuptools<82
File without changes
File without changes