CVE-2026-41246: Contour: Lua code injection via Cookie Path Rewrite Policy
Contour is a Kubernetes ingress controller using Envoy proxy. From v1.19.0 to before v1.33.4, v1.32.5, and v1.31.6, Contour's Cookie Rewriting feature is vulnerable to Lua code injection. An attacker with RBAC permissions to create or modify HTTPProxy resources can craft a malicious value in spec.routes[].cookieRewritePolicies[].pathRewrite.value or spec.routes[].services[].cookieRewritePolicies[].pathRewrite.value that results in arbitrary code execution in the Envoy proxy. The cookie rewriting feature is internally implemented using Envoy's HTTP Lua filter. User-controlled values are interpolated into Lua source code using Go text/template without sufficient sanitization. The injected code only executes when processing traffic on the attacker's own route, which they already control. However, since Envoy runs as shared infrastructure, the injected code can also read Envoy's xDS client credentials from the filesystem or cause denial of service for other tenants sharing the Envoy instance. This vulnerability is fixed in v1.33.4, v1.32.5, and v1.31.6.
Security readout for executives and security teams
Plain-English summary
Contour, a Kubernetes ingress controller, could let a user who already has permission to edit HTTPProxy routes inject Lua code into the shared Envoy proxy through cookie path rewriting. The business risk is tenant-to-tenant impact: stolen Envoy xDS credentials or denial of service from infrastructure shared across routes.
Executive priority
Prioritize remediation for shared Kubernetes ingress environments, especially multi-tenant clusters. This is not unauthenticated internet exposure, but it can turn delegated route management into control over shared proxy infrastructure.
Technical view
Affected Contour versions v1.19.0 through unfixed v1.31.x, v1.32.x, and v1.33.x interpolate cookieRewritePolicies pathRewrite values into Envoy HTTP Lua filter source using Go text/template without sufficient sanitization. Execution is limited to traffic on the attacker-controlled route, but the Envoy process is shared infrastructure.
Likely exposure
Exposure is likely in Kubernetes environments running Contour before v1.31.6, v1.32.5, or v1.33.4 where untrusted or lower-trust users can create or modify HTTPProxy resources using Cookie Rewriting.
Exploitation context
The supplied sources do not state active exploitation, and KEV is false. Exploitation requires authenticated Kubernetes RBAC permission to create or modify HTTPProxy resources and traffic reaching the attacker’s own route.
Researcher notes
Key boundaries matter: the attacker already controls their route, but code runs inside Envoy. Validate version, RBAC delegation, and Cookie Rewriting usage before estimating blast radius. Do not assume products beyond Contour are affected from the supplied evidence.
Mitigation direction
Upgrade Contour to v1.31.6, v1.32.5, v1.33.4, or later supported releases.
Restrict HTTPProxy create and update permissions to trusted operators only.
Review use of cookieRewritePolicies pathRewrite values in tenant-controlled routes.
Consult Contour and platform vendor guidance for temporary controls if upgrade is delayed.
Validation and detection
Inventory deployed Contour versions across all clusters and environments.
Search HTTPProxy resources for cookieRewritePolicies with pathRewrite values.
Review Kubernetes RBAC subjects allowed to create or modify HTTPProxy resources.
Check Envoy logs and pod health for unexplained errors or denial-of-service symptoms.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-94: Code execution behavior lookup
Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
The affected technology mentions containers, so container-specific ATT&CK technique review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-94 · source CWE mapping
Improper Control of Generation of Code ('Code Injection')
Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.