Contour Kubernetes Ingress: Lua Code Injection Leads to Envoy RCE
The National Vulnerability Database has detailed CVE-2026-41246, affecting Contour, a Kubernetes ingress controller leveraging Envoy proxy. Versions from v1.19.0 up to, but not including, v1.33.4, v1.32.5, and v1.31.6 are vulnerable to Lua code injection within the Cookie Rewriting feature. An attacker with RBAC permissions to create or modify HTTPProxy resources can inject malicious Lua code into spec.routes[].cookieRewritePolicies[].pathRewrite.value or spec.routes[].services[].cookieRewritePolicies[].pathRewrite.value fields. This ultimately leads to arbitrary code execution within the Envoy proxy.
While the injected code only executes when processing traffic on the attacker’s own controlled route, the implications are severe given Envoy’s shared infrastructure nature. The National Vulnerability Database states that this vulnerability could allow an attacker to read Envoy’s xDS client credentials directly from the filesystem or trigger denial-of-service conditions for other tenants sharing the same Envoy instance. This isn’t just about isolated impact; it’s about compromise of shared components that underpin critical cluster functions. The vulnerability stems from insufficient sanitization of user-controlled values interpolated into Lua source code using Go’s text/template.
This isn’t a complex drive-by attack; it requires specific RBAC permissions. However, once those are obtained—perhaps through an earlier compromise or misconfiguration—the blast radius expands significantly. Defenders need to recognize that local code execution on shared infrastructure like Envoy is a critical pivot point for lateral movement and privilege escalation. The National Vulnerability Database confirms that this issue is resolved in Contour versions v1.33.4, v1.32.5, and v1.31.6.
What This Means For You
- If your organization uses Contour as a Kubernetes ingress controller, you need to immediately identify your version. If it's between v1.19.0 and the patched versions (v1.33.4, v1.32.5, v1.31.6), prioritize upgrading to mitigate CVE-2026-41246. Also, audit your RBAC policies for HTTPProxy resource creation/modification to ensure only trusted users have these permissions. This is about preventing a privileged attacker from turning a route into an RCE vector on shared infrastructure.
Related ATT&CK Techniques
🛡️ Detection Rules
3 rules · 6 SIEM formats3 detection rules auto-generated for this incident, mapped to MITRE ATT&CK. Sigma YAML is free — export to any SIEM format via the Intel Bot.
Contour Cookie Rewrite Lua Code Injection - CVE-2026-41246
Indicators of Compromise
| ID | Type | Indicator |
|---|---|---|
| CVE-2026-41246 | Code Injection | Contour Kubernetes ingress controller versions v1.19.0 to before v1.31.6, v1.32.5, v1.33.4 |
| CVE-2026-41246 | RCE | Contour's Cookie Rewriting feature via spec.routes[].cookieRewritePolicies[].pathRewrite.value or spec.routes[].services[].cookieRewritePolicies[].pathRewrite.value |
| CVE-2026-41246 | Information Disclosure | Envoy proxy xDS client credentials from filesystem via Lua code injection |
| CVE-2026-41246 | DoS | Denial of Service for other tenants sharing the Envoy instance via Lua code injection |
Source & Attribution
| Source Platform | NVD |
| Channel | National Vulnerability Database |
| Published | April 23, 2026 at 22:17 UTC |
This content was AI-rewritten and enriched by Shimi's Cyber World based on the original source. All intellectual property rights remain with the original author.
Believe this infringes your rights? Submit a takedown request.