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)

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.0

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.0
File Size Uploaded Provenance Actions
attackmap_analyzer_php_laminas-0.2.0.tar.gz 32.0 kB With provenance Details for attackmap_analyzer_php_laminas-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 54.6 kB

Release files / attackmap_analyzer_php_laminas-0.2.0.tar.gz

Download URL attackmap_analyzer_php_laminas-0.2.0.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
36219026bbe5e1c16edb908858c796e5316e728ad95cf2915f65848ec4c6b9af
BLAKE2b-256 checksum
How to use checksums
099a9ea68e7bc2a0860e192fa82147c973b650bc8b628c066e3f8accc985164b
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.0-py3-none-any.whl

Download URL attackmap_analyzer_php_laminas-0.2.0-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
338dc5136022dea83894a022bb3bcf61981a3e0925c52faa5382fe1ee925fafe
BLAKE2b-256 checksum
How to use checksums
786e436d95af97185b1f60929e546547c65559f797a699ccd2ba1cc48eefbae3
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.0

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.0.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.0 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