acc-create-psr15-middleware
Fail
Audited by Gen Agent Trust Hub on Feb 16, 2026
Risk Level: HIGHREMOTE_CODE_EXECUTIONCOMMAND_EXECUTION
Full Analysis
- [REMOTE_CODE_EXECUTION] (HIGH): The
DispatcherMiddlewareinreferences/examples.mdperforms dynamic method calls on objects retrieved from the dependency injection container using request attributes. - Evidence: The code retrieves
_controllerand_actionfrom$request->getAttribute()and then executes$instance->$action($request). - Risk: If the routing system or any previous middleware allows user input to influence these attributes (e.g., via URI segments or query parameters), an attacker could execute arbitrary methods on any class available in the service container, leading to a complete system compromise.
- [COMMAND_EXECUTION] (MEDIUM): The
RateLimitMiddlewareinreferences/templates.mdimplements a flawed client identification logic. - Evidence: The
getClientIpmethod prioritizes theHTTP_X_FORWARDED_FORheader over the actual connection remote address. - Risk: Since the
X-Forwarded-Forheader is client-controlled and untrusted unless the server is behind a verified proxy, attackers can spoof their IP address to bypass rate limits, facilitating brute-force attacks or resource exhaustion. - [DATA_EXFILTRATION] (LOW): The
SessionMiddlewareinreferences/templates.mdgenerates session cookies that are missing theSecureattribute. - Evidence: The cookie string is formatted as
HttpOnly; SameSite=Laxbut does not include theSecureflag. - Risk: Without the
Secureflag, the session cookie can be sent over unencrypted HTTP connections, increasing the risk of session hijacking via packet sniffing in man-in-the-middle (MITM) scenarios.
Recommendations
- AI detected serious security threats
Audit Metadata