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

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

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Apr 2026
- **Updated:** 15 Jul 2026
- **Also known as:** BIT-contour-2026-41246, CLEANSTART-2026-AO30901, CLEANSTART-2026-CF12718, CLEANSTART-2026-PS68952, GHSA-x4mj-7f9g-29h4, GO-2026-5738, MINI-2p5x-cx7p-cgc7, MINI-68wr-6883-73r8

## 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 (Improper Control of Generation of Code)

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/projectcontour/contour` | Go | From 1.19.0 | 1.31.6, 1.32.5, 1.33.4 |
| `github.com/projectcontour/contour` | Go | From 1.19.0 | 1.31.6 |
| `github.com/projectcontour/contour` | Go | From 1.19.0 | 1.31.6 |
| `github.com/projectcontour/contour` | Go | From 1.32.0 | 1.32.5 |
| `github.com/projectcontour/contour` | Go | From 1.32.0 | 1.32.5 |
| `github.com/projectcontour/contour` | Go | From 1.33.0 | 1.33.4 |
| `github.com/projectcontour/contour` | Go | From 1.33.0 | 1.33.4 |
| `contour` | Bitnami | From 1.19.0 | 1.31.6, 1.32.5, 1.33.4 |

Products: 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.

## Is CVE-2026-41246 being exploited?

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

## Other vulnerabilities in projectcontour contour

- [CVE-2024-36539](https://insights.sbomify.com/CVE-2024-36539/): Missing authorization in n/a (critical 9.8)
- [CVE-2021-32783](https://insights.sbomify.com/CVE-2021-32783/): Authorization bypass in Contour (high 8.5)
- [CVE-2020-15127](https://insights.sbomify.com/CVE-2020-15127/): Denial of service in Contour (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-41246 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2026-41246 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/projectcontour/contour (Go): affected from 1.19.0; fixed in 1.31.6, 1.32.5, 1.33.4
- github.com/projectcontour/contour (Go): affected from 1.19.0; fixed in 1.31.6
- github.com/projectcontour/contour (Go): affected from 1.19.0; fixed in 1.31.6
- github.com/projectcontour/contour (Go): affected from 1.32.0; fixed in 1.32.5
- github.com/projectcontour/contour (Go): affected from 1.32.0; fixed in 1.32.5
- github.com/projectcontour/contour (Go): affected from 1.33.0; fixed in 1.33.4
- github.com/projectcontour/contour (Go): affected from 1.33.0; fixed in 1.33.4
- contour (Bitnami): affected from 1.19.0; fixed in 1.31.6, 1.32.5, 1.33.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-41246/ (Markdown: https://insights.sbomify.com/CVE-2026-41246/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-41246
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-41246
- OSV: https://osv.dev/vulnerability/CVE-2026-41246

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-41246/
Summaries are generated and may contain mistakes; the official description above is the record.
