Skip to main content

attackmap-analyzer-php-laminas

Framework-aware Laminas analyzer for AttackMap.

This module focuses on structured signal extraction for Laminas/Zend MVC projects:

  • route paths from the 'router' => ['routes' => [...]] config tree, walked structurally (see Routes); route names such as navigation's 'route' => 'home' are not routes
  • Mezzio/Expressive routes ($app->get('/x', ...), ->post/put/patch/delete/any, $app->route('/x', $mw, ['GET', 'POST'])) in files that reference Mezzio\ or Zend\Expressive\
  • controller mapping hints
  • service-manager mapping hints
  • broad PHP security signals (outbound calls, datastore, auth, secret hints)

Install

uv tool install attackmap --with attackmap-analyzer-php-laminas    # from PyPI
# or: pip install attackmap-analyzer-php-laminas    (installs attackmap too)
# or from source:
pip install git+https://github.com/mlaify/attackmap-analyzer-php-laminas.git

The analyzer is auto-discovered by AttackMap via the attackmap.analyzers entry-point group.

Analyzer identity

  • name: php-laminas
  • display_name: PHP Laminas Analyzer
  • version: 0.1.0
  • experimental: true
  • enabled_by_default: false

Detection

detect(repo_path) returns true when one or more Laminas indicators exist:

  • composer dependencies beginning with laminas/, zendframework/ or mezzio/
  • a module/ directory together with config/application.config.php
  • any module.config.php outside vendor/ (and the other shared skip dirs)

A generic src/, app/ or config/ directory on its own is not enough.

Routes

Router config is read with a small PHP-array tokenizer (phparray.py) that balances [/] and array(/) and skips strings, heredocs and comments, so a route is reported with its full path:

  • child_routes are joined onto the parent path: '/admin' → '/users' → '/:id' is /admin/users/:id. A parent with children is itself a route only with 'may_terminate' => true.
  • Method routes ('type' => Method::class, 'options' => ['verb' => 'post'], or 'get,head') set the HTTP method on the parent's path instead of adding a path.
  • Segment optional parts are expanded progressively: the minimal form, then one more optional group opened at a time in source order, at most 4 paths per route. /:controller[/:action[/:id]] gives /:controller, /:controller/:action and /:controller/:action/:id; sibling groups [/a][/b] give '', /a, /a/b (not /b alone). A child path joins the parent's maximal form, because Laminas' parent route consumes its optional parts greedily and never backs off (/h[/:action] + /x is reachable only as /h/:action/x); a child that can match nothing ([/:id]) keeps every parent form (/h, /h/:action, /h/:action/:id). A trailing [/] doesn't add a path; :id{-} delimiters and translated {literal} parts are normalized.
  • Regex routes use their spec (%id% → :id); Hostname/Scheme routes add no path; Part, Wildcard, Query and console routes are skipped.
  • Config merged across modules: a module's 'admin' => ['child_routes' => [...]] stub (no type or route of its own) joins onto the admin route another module defines, as Laminas' config merge does. A stub extending a route no file defines is skipped.
  • A file that only returns a route map (required from a router config) is walked too, and 'router' => $router / 'routes' => $routes follow a same-file $routes = [...] assignment.
  • Method children apply to every expanded form of the parent: /user[/:id] with a delete child gives DELETE /user and DELETE /user/:id.
  • Any 'route' => '/path' literal the walk didn't reach (routes built with array_merge, in loops, or past the tokenizer's 500k-token cap) keeps the flat match, except literals inside a child_routes array, which are only fragments of a path.

Non-UTF-8 sources (cp1252/latin-1, common in ZF1/ZF2 code) are decoded by attackmap.sdk.read_source rather than skipped.

Notes

This analyzer is heuristic and intentionally avoids AST parsing in this first iteration.

Secret hints are env var names (getenv, $_ENV, $_SERVER) containing SECRET, TOKEN, KEY, PASSWORD or PASSWD, matched case-sensitively; DB_HOST-style connection settings are not secrets. jwt needs a JWT library (Firebase\JWT\JWT, JWT::decode/encode, Lcobucci\JWT, tymon/jwt-auth), and auth needs the Auth:: facade or a chained auth()->… helper.

Metadata

Release files for attackmap-analyzer-php-laminas 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attackmap-analyzer-php-laminas 0.2.1
File Size Uploaded Provenance Actions
attackmap_analyzer_php_laminas-0.2.1.tar.gz 32.3 kB With provenance Details for attackmap_analyzer_php_laminas-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for attackmap-analyzer-php-laminas 0.2.1
File Interpreter ABI Platform Actions
attackmap_analyzer_php_laminas-0.2.1-py3-none-any.whl Python 3 none any Details for attackmap_analyzer_php_laminas-0.2.1-py3-none-any.whl

Total release size: 55.1 kB

Release files / attackmap_analyzer_php_laminas-0.2.1.tar.gz

Download URL attackmap_analyzer_php_laminas-0.2.1.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
076924b511e8b2beb0e3ea5ca00136441aa49d711b42f2697079e543dd0305c3
BLAKE2b-256 checksum
How to use checksums
e7a20b24cb2dfadf585ab99a45f2bdd828eb411ce96e70b790dae0d99fe80438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Release files / attackmap_analyzer_php_laminas-0.2.1-py3-none-any.whl

Download URL attackmap_analyzer_php_laminas-0.2.1-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e1eadb5b4697a3ced673aaa39e5994b065d87caea668f053fb27844d40a742d
BLAKE2b-256 checksum
How to use checksums
029278ba661a3d2edb6654352289f41f6ccf9b9060de07cfa84f81571a7cbf82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for attackmap-analyzer-php-laminas 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for attackmap_analyzer_php_laminas-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page