Summary
A path validation weakness in Envoy Gateway can allow Lua submitted through an EnvoyExtensionPolicy to bypass critical-path checks by using redundant path separators.
When the gateway controller processes the Lua, an attacker who can submit or influence the policy may read arbitrary files from the controller pod, including credentials and sensitive runtime data.
Affected context
The issue occurs in Envoy Gateway's Lua validation logic when default Strict validation evaluates Lua submitted through an EnvoyExtensionPolicy. The validator normalizes absolute paths but does not collapse redundant separators before checking whether a path is critical, while Linux may resolve those separators to the corresponding ordinary path. Deployments are exposed when an attacker can create or modify policies that submit Lua to the gateway controller.
Exploit preconditions
- Attack surface: EnvoyExtensionPolicy handling and Lua validation in the gateway controller
- Required access: Permission to create, modify, or otherwise influence an applicable EnvoyExtensionPolicy
- Trigger point: Validation and execution of submitted Lua that references a filesystem path containing redundant separators
- Why exploitation is possible: The validator and Linux filesystem resolve equivalent paths differently, allowing a restricted-path check to be bypassed before file access occurs
Why this happens
The underlying bug is incomplete canonicalization of user-controlled filesystem paths before security validation. The validator checks whether a path is critical without first normalizing redundant separators, while the operating system interprets the resulting path as an equivalent single-separator location. This inconsistent interpretation maps to CWE-20: Improper Input Validation and creates a path-validation bypass that can expose files outside the intended access scope.
Potential impact
- An attacker may read arbitrary files accessible to the gateway controller pod.
- Kubernetes service-account tokens could be disclosed.
- TLS certificates, configuration data, or process environment information could be exposed.
- Disclosed credentials could enable unauthorized access to Kubernetes API Server resources.
- Sensitive Gateway xDS server information could be obtained.
- The incident could enable broader cluster or control-plane compromise depending on pod privileges.
General mitigation guidance
Mitigation generally focuses on making path handling consistent with the operating system's canonical interpretation before applying security decisions.
Common defensive patterns include:
- Canonicalizing and collapsing redundant path separators before allowlist or denylist checks.
- Applying validation to the normalized representation that will actually be used for file access.
- Restricting Lua file access to an explicit, minimal allowlist of required resources.
- Reducing the gateway controller's filesystem visibility and Kubernetes permissions.
- Avoiding service-account token mounting where it is not required.
- Running controller workloads with least privilege and limiting access to sensitive environment data.
- Enforcing policy admission controls so only trusted identities can submit EnvoyExtensionPolicy resources.
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis rules that identify path checks performed before canonicalization.
- Code review searches for inconsistent handling of duplicate separators, dot segments, symbolic links, and encoded path forms.
- Tests that compare validator behavior with the operating system's path resolution behavior.
- Policy auditing for unexpected EnvoyExtensionPolicy authors or Lua filesystem access.
- Runtime monitoring for unusual reads of service-account tokens, certificates, environment files, or controller configuration.
- Admission policies that restrict Lua-bearing gateway policies to approved namespaces and identities.
Automated security review tools may help identify path normalization and input-validation gaps, but their findings should be confirmed against actual deployment permissions and filesystem behavior.

