Summary
Calico's Dikastes component may incorrectly authorize HTTP requests when Application Layer Policy Prefix rules evaluate paths containing traversal segments, encoded slashes, or repeated slashes. If a downstream workload or proxy normalizes the path differently, an attacker with network access may reach endpoints intended to be restricted, particularly where the policy feature is enabled.
Affected context
The issue occurs in Calico deployments that enable the Application Layer Policy feature and use Dikastes to enforce HTTP path rules. Risk depends on a mismatch between the path representation evaluated by Dikastes and the normalized representation later used by a workload or fronting proxy. The feature is disabled by default, so deployments must explicitly enable it and define affected Prefix-based policies for the condition to arise.
Exploit preconditions
- Attack surface: HTTP endpoints protected by Calico Application Layer Policy
- Required access: Network access to a reachable workload or service; no special Kubernetes RBAC is generally required
- Trigger point: A request path containing traversal segments, encoded slashes, or repeated slashes
- Policy condition: A Dikastes Prefix rule evaluates the non-normalized path as permitted
- Why exploitation is possible: A downstream workload or proxy may normalize the path and route it to a restricted endpoint after policy evaluation
Why this happens
The underlying bug is inconsistent URL path canonicalization across security enforcement layers. Dikastes evaluates certain non-canonical paths without first applying the normalization rules used by downstream components, allowing a request to match an authorized Prefix even though its normalized destination is outside that prefix.
This behavior maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with CWE-23: Relative Path Traversal describing traversal-segment variants. The insecure pattern is enforcing authorization decisions on a path representation that may differ from the representation used for routing.
Potential impact
- An attacker may bypass intended HTTP path restrictions
- Restricted application endpoints could become reachable
- Sensitive data or administrative functionality could be exposed
- Workloads may process requests that policy authors intended to deny
- Downstream authorization assumptions could be weakened
General mitigation guidance
Mitigation generally focuses on ensuring that authorization and routing operate on the same canonical path representation.
Common defensive patterns include:
- Applying consistent, standards-based URL normalization before path policy evaluation
- Rejecting ambiguous, malformed, or non-canonical path forms at the earliest trusted boundary
- Avoiding security decisions based solely on Prefix matching when canonicalization differs across components
- Aligning proxy, service, and application routing behavior with the policy enforcement layer
- Limiting exposure of sensitive endpoints through defense-in-depth controls at the application and gateway layers
- Keeping Application Layer Policy disabled when it is not required and applying least privilege to exposed services
How teams detect issues like this
Detection approaches commonly include:
- Static and configuration analysis for HTTP Prefix policies that protect sensitive endpoints without canonicalization controls
- Code and policy review signals involving path matching before normalization
- Differential testing of equivalent URL forms, including traversal segments, encoded separators, and repeated slashes
- Proxy-to-workload tests that compare the path authorized by the policy with the path ultimately routed
- Policy enforcement checks requiring canonicalization or explicit rejection of ambiguous paths
- Runtime monitoring for denied-policy bypass indicators and unusual requests targeting restricted routes

