{"id":"CVE-2026-41246","aliases":["CVE-2026-41246","GHSA-x4mj-7f9g-29h4","BIT-CONTOUR-2026-41246","GO-2026-5738"],"related":[],"kind":"vulnerability","state":"published","title":"Contour: Lua code injection via Cookie Path Rewrite Policy","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nContour's [Cookie Rewriting](https://projectcontour.io/docs/1.33/config/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 the following fields that results in arbitrary code execution in the Envoy proxy:\n\n- `spec.routes[].cookieRewritePolicies[].pathRewrite.value`\n- `spec.routes[].services[].cookieRewritePolicies[].pathRewrite.value`\n\nThe cookie rewriting feature is internally implemented using Envoy's [HTTP Lua filter](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/lua_filter). User-controlled values are interpolated into Lua source code using Go `text/template` without sufficient sanitization.\n\nThe 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:\n\n- Read Envoy's xDS client credentials from the filesystem, which could be used to read all Contour xDS configuration, including TLS certificates and private keys of other tenants.\n- Cause denial of service for other tenants sharing the Envoy instance.\n\nOther use cases of Lua filter are not vulnerable.\n\n### Patches\n\nThe fix is available in Contour [v1.33.4](https://github.com/projectcontour/contour/releases/tag/v1.33.4), [v1.32.5](https://github.com/projectcontour/contour/releases/tag/v1.32.5), and [v1.31.6](https://github.com/projectcontour/contour/releases/tag/v1.31.6).\n\n- v1.33.4: User-provided values are no longer interpolated into Lua code. Use of `text/template` is removed. Requires Envoy 1.35.0 or later.\n- v1.32.5, v1.31.6: User-provided values are escaped before interpolation into Lua code.\n\n### Workarounds\n\nThere are no workarounds. Users should upgrade to a patched version.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Contour has Lua code injection via Cookie Path Rewrite Policy in github.com/projectcontour/contour","format":"markdown","source":"go"},{"lang":"es","text":"Contour es un controlador de entrada de Kubernetes que utiliza el proxy Envoy. Desde la v1.19.0 hasta antes de la v1.33.4, v1.32.5 y v1.31.6, la característica de reescritura de cookies de Contour es una vulnerabilidad a la inyección de código Lua. Un atacante con permisos RBAC para crear o modificar recursos HTTPProxy puede elaborar un valor malicioso en spec.routes[].cookieRewritePolicies[].pathRewrite.value o spec.routes[].services[].cookieRewritePolicies[].pathRewrite.value que resulta en ejecución de código arbitrario en el proxy Envoy. La característica de reescritura de cookies se implementa internamente utilizando el filtro HTTP Lua de Envoy. Los valores controlados por el usuario se interpolan en el código fuente Lua utilizando Go text/template sin suficiente sanitización. El código inyectado solo se ejecuta al procesar tráfico en la propia ruta del atacante, la cual ya controlan. Sin embargo, dado que Envoy se ejecuta como infraestructura compartida, el código inyectado también puede leer las credenciales de cliente xDS de Envoy del sistema de archivos o causar denegación de servicio para otros inquilinos que comparten la instancia de Envoy. Esta vulnerabilidad se corrige en v1.33.4, v1.32.5 y v1.31.6.","source":"nvd"}],"published":"2026-04-23T18:44:39.907Z","modified":"2026-10-26T22:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":8.1,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":8.1,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":">= 1.33.0, < 1.33.4","status":"affected"},{"version":">= 1.32.0, < 1.32.5","status":"affected"},{"version":">= 1.19.0, < 1.31.6","status":"affected"}],"vendor":"projectcontour","product":"contour","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"ExternalDNS Operator","package":"edo/external-dns-rhel8","cpe":"cpe:/a:redhat:ext_dns_optr:1","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"ExternalDNS Operator","package":"edo/external-dns-rhel9","cpe":"cpe:/a:redhat:ext_dns_optr:1","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.19.0","status":"affected","fixed":"1.31.6"}],"ecosystem":"Go","package":"github.com/projectcontour/contour","purl":"pkg:golang/github.com/projectcontour/contour","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.32.0","status":"affected","fixed":"1.32.5"}],"ecosystem":"Go","package":"github.com/projectcontour/contour","purl":"pkg:golang/github.com/projectcontour/contour","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.33.0","status":"affected","fixed":"1.33.4"}],"ecosystem":"Go","package":"github.com/projectcontour/contour","purl":"pkg:golang/github.com/projectcontour/contour","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.19.0","status":"affected","fixed":"1.31.6"},{"type":"semver","introduced":"1.32.0","status":"affected","fixed":"1.32.5"},{"type":"semver","introduced":"1.33.0","status":"affected","fixed":"1.33.4"}],"ecosystem":"Go","package":"github.com/projectcontour/contour","purl":"pkg:golang/github.com/projectcontour/contour","source":"go"},{"ranges":[{"status":"affected","introduced":"1.19.0","fixed":"1.31.6"},{"status":"affected","introduced":"1.32.0","fixed":"1.32.5"},{"status":"affected","introduced":"1.33.0","fixed":"1.33.4"}],"vendor":"projectcontour","product":"contour","cpe":"cpe:2.3:a:projectcontour:contour:*:*:*:*:*:kubernetes:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"1.19.0","status":"affected","fixed":"1.31.6"},{"type":"semver","introduced":"1.32.0","status":"affected","fixed":"1.32.5"},{"type":"semver","introduced":"1.33.0","status":"affected","fixed":"1.33.4"}],"ecosystem":"Bitnami","package":"contour","purl":"pkg:bitnami/contour","source":"bitnami"}],"references":[{"url":"https://github.com/projectcontour/contour/security/advisories/GHSA-x4mj-7f9g-29h4","tags":["advisory","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://github.com/projectcontour/contour/releases/tag/v1.31.6","tags":["article","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://github.com/projectcontour/contour/releases/tag/v1.32.5","tags":["article","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://github.com/projectcontour/contour/releases/tag/v1.33.4","tags":["article","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-41246","tags":["vdb-entry","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2461257","tags":["issue-tracking","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41246.json","tags":["web","x-sadp-csaf-vex"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41246","tags":["advisory","web"],"sources":["ghsa","go","bitnami"]},{"url":"https://github.com/projectcontour/contour","tags":["package"],"sources":["ghsa"]},{"url":"https://projectcontour.io/docs/1.33/config/cookie-rewriting","tags":["web"],"sources":["ghsa","go"]},{"url":"https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/lua_filter","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-24T14:15:49.308Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41246","url":"https://www.cve.org/CVERecord?id=CVE-2026-41246","licence":"CVE Terms of Use","modified":"2026-07-15T00:59:40.254Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-x4mj-7f9g-29h4","url":"https://github.com/advisories/GHSA-x4mj-7f9g-29h4","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:03.970Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5738","url":"https://pkg.go.dev/vuln/GO-2026-5738","licence":"CC-BY-4.0","modified":"2026-06-25T23:11:02.965Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41246","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41246","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-CONTOUR-2026-41246","url":"https://osv.dev/vulnerability/BIT-CONTOUR-2026-41246","licence":"Apache-2.0","modified":"2026-09-08T08:46:02.347Z"}],"updatedAt":"2026-11-25T22:59:19.408Z","epss":{"score":0.005,"percentile":0.4446,"date":"2026-12-02T12:00:21.000Z"}}