Summary
ORY Oathkeeper versions prior to 26.2.0 are vulnerable to an HTTP path traversal issue where access rules are evaluated against the raw request path instead of the normalized path.
An attacker can craft URLs with traversal sequences (such as /public/../admin/secrets) that are treated internally as protected endpoints after normalization, but are incorrectly matched against permissive rules, leading to an authorization bypass.
Affected context
The vulnerability appears in deployments where ORY Oathkeeper sits in front of backend services and uses Access Rules to authorize HTTP requests.
It specifically affects configurations that:
- Depend on path-based rules for access control
- Have a mix of permissive and restrictive rules differentiated by URL path segments
- Rely on Oathkeeper's rule evaluation to protect sensitive endpoints (e.g.,
/admin,/secrets,/internal)
The issue manifests when the proxy normalizes paths (resolving .. and redundant separators) for routing, but applies authorization logic to the un-normalized raw path.
Exploit preconditions
- Attack surface: Publicly reachable HTTP endpoints served through ORY Oathkeeper.
- Required access: Ability to send crafted HTTP requests to the Oathkeeper-protected service (no prior authentication needed if any public rule exists).
- Trigger point: Submission of URLs containing directory traversal-like segments such as
/segment/../other-segmentthat result in a normalized path pointing to a sensitive or restricted resource. - Why exploitation is possible: Oathkeeper's rule matching logic evaluates the raw request path (including
../segments) against access rules, while the underlying routing or backend sees the normalized path. This mismatch allows a request to be authorized under a permissive rule while ultimately reaching a protected path.
Why this happens
The underlying defect is a mismatch between the path representation used for authorization decisions and the path actually used for routing to backend resources.
In abstract terms, this aligns with CWE-23: Relative Path Traversal, but applied at the authorization layer: un-normalized paths containing traversal sequences are treated as distinct from their normalized equivalents during rule evaluation.
Because access rules are based on the raw path, a request like /public/../admin/secrets can match a rule intended for /public/*, even though the effective destination after normalization is /admin/secrets.
This inconsistent canonicalization between authorization and routing enables bypass of path-based protections.
Potential impact
- Unauthorized access to administrative or internal endpoints that are intended to be restricted
- Exposure of sensitive data such as configuration, secrets, or user records
- Ability to invoke privileged management APIs or debug interfaces
- Lateral movement within internal services by accessing hidden or undocumented routes
- Circumvention of compliance or regulatory controls that rely on strict segregation of public and private endpoints
General mitigation guidance
Robust mitigation focuses on ensuring consistent path canonicalization before authorization and designing rules that are resilient to traversal-like sequences.
Common defensive patterns include:
- Normalizing or canonicalizing request paths (resolving
.and.., redundant slashes, URL-encoded separators) before performing any rule matching or access control decisions. - Defining access rules using canonical path forms only, and rejecting or redirecting requests with ambiguous or non-canonical paths.
- Preferring deny-by-default policies where sensitive paths must be explicitly allowed rather than implicitly blocked by relying on path prefixes or assumptions about structure.
- Layering access control so that backends themselves enforce authentication and authorization, not just the proxy, especially for critical endpoints.
- Minimizing overlapping or overly broad "public" rules (e.g.,
/*or/public/**) that can be abused to catch traversal-crafted paths.
How teams detect issues like this
Effective detection combines configuration analysis with runtime observation:
- Configuration review: Examine Oathkeeper access rule definitions for broad, path-prefix-based public rules that overlap with sensitive paths (e.g.,
/public/**near/admin/**or/internal/**). - Static analysis / policy linting: Apply rules that flag use of path-based authorization where canonicalization is not explicit, or where traversal sequences and URL-encoded separators are not normalized prior to evaluation.
- Runtime logging and monitoring: Log both raw and normalized paths for incoming requests and alert on patterns containing
../,./, excessive slashes, or encoded equivalents (%2e%2e/, etc.), especially when they result in access to restricted resources. - Security testing: Include path traversal variants in automated API security tests and regression test suites to validate that authorization decisions are identical for semantically equivalent paths.
- Automated code and configuration review tools can be integrated into CI pipelines to highlight risky rule definitions and inconsistent canonicalization logic.

