class

Analyzer::Php::Magento

Inherits Analyzer::Php::PhpEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

Magento 2 attack-surface extractor.

Magento exposes two distinct HTTP surfaces:

  • Web API (REST) — declared in etc/webapi.xml: <route url="/V1/products/:sku" method="GET"> ... </route> served under the /rest prefix -> /rest/V1/products/{sku}.

  • MVC controllers — a module's etc/{area}/routes.xml binds a module to a URL frontName, and each Controller/.../Action.php class (with an execute() method) maps to /{frontName}/{controller}/{action}.

We parse only webapi.xml / routes.xml (a Magento tree is full of other XML — module.xml, di.xml, config.xml, acl.xml …) and controller classes under /Controller/.

Constants

HTTP_ACTION_INTERFACES = {"HttpGetActionInterface" => "GET", "HttpPostActionInterface" => "POST", "HttpPutActionInterface" => "PUT", "HttpDeleteActionInterface" => "DELETE", "HttpPatchActionInterface" => "PATCH"}

Http{Verb}ActionInterface markers a controller can implement to declare the HTTP methods it accepts.

Class methods

tech_name
Source

Instance methods

analyze
Source
analyze_file(path : String) : Array(Endpoint)
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source