CVE-2026-41246 Contour: Lua code injection via Cookie Path Rewrite Policy

High 8.1 Published Updated

Attackers with RBAC permissions can inject Lua code via cookie rewrite policies, leading to code execution, credential theft, or denial of service in Envoy.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-41246?

CVE-2026-41246 is a high-severity code injection vulnerability in projectcontour contour, published on 23 Apr 2026. Any signed-in user can exploit it over the network, with no action from the victim.

Official 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.

Weakness: CWE-94

Which versions are affected by CVE-2026-41246?

8 open source packages ship an affected version, including github.com/projectcontour/contour and contour. It affects 1 product.

PackageAffectedFixed in
github.com/projectcontour/contour GoFrom 1.19.01.31.6, 1.32.5, 1.33.4
github.com/projectcontour/contour GoFrom 1.19.01.31.6
github.com/projectcontour/contour GoFrom 1.19.01.31.6
github.com/projectcontour/contour GoFrom 1.32.01.32.5
github.com/projectcontour/contour GoFrom 1.32.01.32.5
github.com/projectcontour/contour GoFrom 1.33.01.33.4
2 more packages
github.com/projectcontour/contour GoFrom 1.33.01.33.4
contour BitnamiFrom 1.19.01.31.6, 1.32.5, 1.33.4

Products include Projectcontour Contour.

How do I fix CVE-2026-41246?

Upgrade github.com/projectcontour/contour to a fixed version for your release line: 1.31.6, 1.32.5 or 1.33.4.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-41246 being exploited?

There is no known exploitation of CVE-2026-41246 in the wild and no public exploit code.

Sources

Also known as BIT-contour-2026-41246, CLEANSTART-2026-AO30901, CLEANSTART-2026-CF12718, CLEANSTART-2026-PS68952, GHSA-x4mj-7f9g-29h4, GO-2026-5738 and 2 more.

Is CVE-2026-41246 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free