Join our Newsletter — 33% off our NHI Course
Architecture & Implementation

PATH_INFO

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Architecture & Implementation

PATH_INFO is an HTTP environment variable that carries the extra path segment in a request after the script or application mapping. Web servers and CGI-style runtimes use it to pass routing details to the backend, which can affect URL handling, path parsing and access control if application code trusts it incorrectly.

PATH_INFO and request routing

PATH_INFO is the part of a request path that comes after the script or application mapping. In CGI-style and similar deployments, it helps preserve routing detail for the backend so code can decide which resource or sub-route the client intended. The variable is simple, but it becomes security-relevant when applications treat it as a trusted source of truth.

Because PATH_INFO is derived from the request URI, it often sits at the boundary between the web server and the application framework. That makes it useful for clean routing, but also easy to mis-handle when server rewrite rules, framework routing logic, and application-level path parsing do not agree on what the “real” path is.

How PATH_INFO is used by web servers and runtimes

Web servers typically split the incoming URL into a mapped script path and any trailing path information. The backend receives PATH_INFO so it can route to a nested resource, a REST-style endpoint, or a legacy CGI handler without the server needing to know application-specific route semantics. In practice, the exact behaviour varies across servers, gateways, and frameworks, so implementations should not assume identical parsing rules everywhere.

This variability matters because some stacks normalise slashes, decode characters, or apply path rewriting before PATH_INFO reaches the application, while others preserve the raw segment more closely. If the application and the front-end server disagree about path handling, security checks may be performed on one path representation while the request is ultimately dispatched using another.

Why PATH_INFO can affect access control and URL interpretation

PATH_INFO becomes risky when application code uses it to infer privilege boundaries, tenant context, file locations, or protected routes. A path segment that looks harmless in one parsing layer may be interpreted differently in another, which can lead to broken routing, bypassed authorization checks, or unintended resource access. The danger is not PATH_INFO itself, but trusting it without a clear canonicalisation model.

Security failures often appear when a developer assumes the routed path, the script path, and the effective application path are the same thing. If URL decoding, trailing slash handling, or route matching is inconsistent, attackers may reach endpoints that the application did not intend to expose, or may cause the application to validate one path and execute another.

Common failure patterns and safe handling

Defensive handling starts with a single canonical view of the request path. Applications should decide which path form is authoritative, validate it after normalisation, and avoid mixing server-provided routing metadata with application-derived route state unless the trust boundary is explicit. Logging the raw request path alongside the effective route can also help explain unexpected behaviour during review or incident analysis.

When PATH_INFO is part of the design, the safest pattern is to treat it as routing input, not as an authorization decision by itself. Access checks should be based on the application’s resolved route and subject context, with path parsing kept consistent across the reverse proxy, web server, framework, and any middleware that interprets the request.

Risk and Threat Considerations

PATH_INFO can create exposure when attackers exploit differences in URL parsing between the web server and the application. The main risk is that a request may pass one layer’s checks while being interpreted differently by another, which can produce route confusion, authorization bypass, or access to unintended backend functionality.

Failure mechanism: Inconsistent normalisation or trust in request-derived path segments lets an attacker shape the backend’s view of the route, while the front end or security logic believes a different path was requested.

Impact: The result can be broken access control, exposure of hidden endpoints, unsafe file or route selection, or application behaviour that diverges from the security model the operator intended.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV15 — Secure Coding and ArchitecturePATH_INFO handling is an input-routing boundary that affects request interpretation and access control.
V8 — AuthorizationMisused PATH_INFO can turn route parsing into a broken authorization condition.
Recommendation — Canonicalise request paths before routing and enforce authorization on the resolved application path. Verify that authorization checks use the canonical route identity, not an untrusted path fragment.
NIST SP 800-53 Rev 5AC-3 — Access EnforcementPath confusion can bypass request-level access decisions, so access enforcement must follow resolved routing.
Recommendation — Apply AC-3 to enforce access decisions on the final resolved route, not the raw path segment.

Practitioner Guidance

What to watch for: Review PATH_INFO handling wherever the application depends on path structure for routing, tenancy, or authorization decisions. The main warning sign is any stack where the web server, gateway, and application framework do not share the same canonical path rules.

Governance implication: Document which component owns path canonicalisation and require code reviews to verify that access control is enforced after routing is resolved, not before. For systems exposed on the internet, this should be treated as part of secure request handling rather than a purely routing concern.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org