# CVE-2026-41246: Project Contour Lua code injection in Cookie Rewriting feature

Source: https://junglewise.ai/threats/cve-2026-41246-project-contour-lua-code-injection-in-cookie-rewriting-feature  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-04-23. Updated: 2026-07-01  
License: CC BY 4.0 with a link back

CVE-2026-41246 · Severity: high · CVSS 8.1 · Published 2026-04-23

Contour, an open-source ingress controller for Kubernetes, is vulnerable to a code injection flaw in its cookie rewriting feature. An attacker with permissions to manage network routing rules can execute malicious code within the Envoy proxy infrastructure. This could allow the attacker to steal sensitive credentials and encryption keys belonging to other users or cause a service outage for the entire platform.

Technologies: [github.com/projectcontour/contour (Go)](https://junglewise.ai/threats/technologies/github-com-projectcontour-contour). Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2026-41246 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-41246 being exploited in the wild.

**How severe is CVE-2026-41246?** High severity, with a CVSS score of 8.1, published 23 April 2026.

**Which products and versions are affected?** github.com/projectcontour/contour (Go) SEMVER:introduced=1.19.0,fixed=1.31.6, SEMVER:introduced=1.19.0,fixed=1.31.6,introduced=1.32.0,fixed=1.32.5,introduced=1.33.0,fixed=1.33.4.

**Is there a fix for CVE-2026-41246?** Yes. github.com/projectcontour/contour (Go): upgrade to 1.31.6, 1.33.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-41246 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-41246?** Check whether you run github.com/projectcontour/contour (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/projectcontour/contour (Go): upgrade to 1.31.6, 1.33.4 or later

  ```sh
  go get github.com/projectcontour/contour@v1.33.4
  ```


## Technical details

A Lua code injection vulnerability exists in Contour's Cookie Rewriting feature due to improper sanitization of user-controlled values. Specifically, values in the 'pathRewrite.value' fields of HTTPProxy resources are interpolated into Lua source code using Go's 'text/template' engine without sufficient escaping. An attacker with RBAC permissions to create or modify HTTPProxy resources can exploit this to execute arbitrary Lua code within the Envoy proxy. While the code executes during the attacker's own route processing, it can be leveraged to read Envoy's xDS client credentials from the filesystem, potentially exposing TLS certificates and private keys of other tenants, or to trigger a denial of service. The issue is fixed in versions 1.33.4, 1.32.5, and 1.31.6.

## Affected products

- Project Contour Contour >= 1.19.0, < 1.31.6; >= 1.32.0, < 1.32.5; >= 1.33.0, < 1.33.4

## Identifiers

- CVE-2026-41246
- GHSA-x4mj-7f9g-29h4
- GO-2026-5738

## Timeline

- 2026-04-20: disclosed
- 2026-04-23: advisory: NVD publication date
- 2026-04-24: patched: GitHub Advisory published and reviewed

## References

- [https://api.github.com/users/b0b0haha](https://api.github.com/users/b0b0haha)
- [https://github.com/b0b0haha](https://github.com/b0b0haha)
- [https://api.github.com/users/b0b0haha/gists%7B/gist_id%7D](https://api.github.com/users/b0b0haha/gists%7B/gist_id%7D)
- [https://api.github.com/users/b0b0haha/repos](https://api.github.com/users/b0b0haha/repos)
- [https://avatars.githubusercontent.com/u/28356082?v=4](https://avatars.githubusercontent.com/u/28356082?v=4)
- [https://api.github.com/users/b0b0haha/events%7B/privacy%7D](https://api.github.com/users/b0b0haha/events%7B/privacy%7D)

## Related threats

- [Project Contour JWT verification bypass in HTTPProxy](https://junglewise.ai/threats/cve-2026-50149-project-contour-jwt-verification-bypass-in-httpproxy)
- [GO-2022-0922 - ExternalName Services can be used to gain access to Envoy's admin interface in github.com/projectcontour/contour](https://junglewise.ai/threats/cve-2021-32783-externalname-services-can-be-used-to-gain-access-to-envoy-s-admin)
