CVE-2026-41246: CWE-94: Improper Control of Generation of Code ('Code Injection') in projectcontour contour
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.
AI Analysis
Technical Summary
CVE-2026-41246 is a high-severity code injection vulnerability (CWE-94) in projectcontour's Contour Kubernetes ingress controller, specifically in the Cookie Rewriting feature implemented via Envoy's HTTP Lua filter. Versions from 1.19.0 up to but excluding 1.31.6, 1.32.5, and 1.33.4 are affected. The vulnerability allows an attacker with RBAC permissions to create or modify HTTPProxy resources to inject arbitrary Lua code through crafted values in spec.routes[].cookieRewritePolicies[].pathRewrite.value fields. This code executes within the Envoy proxy process, potentially exposing Envoy's xDS client credentials or causing denial of service for other tenants sharing the Envoy instance. The vulnerability is due to unsafe interpolation of user input into Lua source code using Go text/template without adequate sanitization. Fixed versions are 1.31.6, 1.32.5, and 1.33.4.
Potential Impact
An attacker with RBAC permissions to create or modify HTTPProxy resources can achieve arbitrary code execution within the Envoy proxy process by injecting Lua code via cookie rewriting policies. Although the injected code executes only on the attacker's own route, it can read sensitive Envoy xDS client credentials from the filesystem or cause denial of service impacting other tenants sharing the Envoy instance. This elevates the risk of credential compromise and service disruption in multi-tenant environments.
Mitigation Recommendations
Fixed versions of Contour are 1.31.6, 1.32.5, and 1.33.4. Users should upgrade to one of these versions to remediate the vulnerability. The vendor advisory does not indicate any temporary mitigations or that no action is required. Therefore, upgrading to a fixed version is the recommended remediation.
CVE-2026-41246: CWE-94: Improper Control of Generation of Code ('Code Injection') in projectcontour contour
Description
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.
CVSS v3.1
Score 8.1high
Affected software
pkg:github/projectcontour/contourRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-41246 is a high-severity code injection vulnerability (CWE-94) in projectcontour's Contour Kubernetes ingress controller, specifically in the Cookie Rewriting feature implemented via Envoy's HTTP Lua filter. Versions from 1.19.0 up to but excluding 1.31.6, 1.32.5, and 1.33.4 are affected. The vulnerability allows an attacker with RBAC permissions to create or modify HTTPProxy resources to inject arbitrary Lua code through crafted values in spec.routes[].cookieRewritePolicies[].pathRewrite.value fields. This code executes within the Envoy proxy process, potentially exposing Envoy's xDS client credentials or causing denial of service for other tenants sharing the Envoy instance. The vulnerability is due to unsafe interpolation of user input into Lua source code using Go text/template without adequate sanitization. Fixed versions are 1.31.6, 1.32.5, and 1.33.4.
Potential Impact
An attacker with RBAC permissions to create or modify HTTPProxy resources can achieve arbitrary code execution within the Envoy proxy process by injecting Lua code via cookie rewriting policies. Although the injected code executes only on the attacker's own route, it can read sensitive Envoy xDS client credentials from the filesystem or cause denial of service impacting other tenants sharing the Envoy instance. This elevates the risk of credential compromise and service disruption in multi-tenant environments.
Mitigation Recommendations
Fixed versions of Contour are 1.31.6, 1.32.5, and 1.33.4. Users should upgrade to one of these versions to remediate the vulnerability. The vendor advisory does not indicate any temporary mitigations or that no action is required. Therefore, upgrading to a fixed version is the recommended remediation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-18T03:47:03.135Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-41246","vendor":"Red Hat"}]
Threat ID: 69ea9e7887115cfb686fc39e
Added to database: 04/23/2026, 22:34:32 UTC
Last enriched: 07/15/2026, 09:14:25 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 99
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.