<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Project Contour — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/project-contour/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 09 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/project-contour/feed.xml" rel="self" type="application/rss+xml"/><item><title>Contour HTTPProxy Lua Code Injection via Cookie Path Rewrite</title><link>https://feed.craftedsignal.io/briefs/2024-01-09-contour-lua-injection/</link><pubDate>Tue, 09 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-09-contour-lua-injection/</guid><description>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 the `spec.routes[].cookieRewritePolicies[].pathRewrite.value` or `spec.routes[].services[].cookieRewritePolicies[].pathRewrite.value` fields, resulting in arbitrary code execution in the Envoy proxy.</description><content:encoded><![CDATA[<p>Project Contour is susceptible to Lua code injection within its cookie rewriting functionality. The vulnerability arises from insufficient sanitization when user-controlled values are interpolated into Lua source code using Go&rsquo;s <code>text/template</code>. This affects Contour versions 1.19.0 through 1.33.3. An attacker with the ability to create or modify <code>HTTPProxy</code> resources can inject arbitrary Lua code by crafting malicious values in <code>spec.routes[].cookieRewritePolicies[].pathRewrite.value</code> or <code>spec.routes[].services[].cookieRewritePolicies[].pathRewrite.value</code>. While the injected code executes within the attacker&rsquo;s own route, the shared nature of the Envoy proxy allows for potential escalation of privileges, including reading Envoy&rsquo;s xDS client credentials and causing denial of service for other tenants. This vulnerability is resolved in Contour versions v1.33.4, v1.32.5, and v1.31.6.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains RBAC permissions to create or modify <code>HTTPProxy</code> resources within the Contour environment.</li>
<li>The attacker crafts a malicious <code>HTTPProxy</code> resource containing a <code>cookieRewritePolicies</code> section.</li>
<li>Within the <code>cookieRewritePolicies</code>, the attacker injects Lua code into the <code>pathRewrite.value</code> field.</li>
<li>The attacker applies the crafted <code>HTTPProxy</code> resource, deploying the malicious configuration to Contour.</li>
<li>Contour, using the Envoy proxy, processes the <code>HTTPProxy</code> resource, interpolating the attacker-controlled value into the Lua filter.</li>
<li>When traffic is processed on the attacker&rsquo;s route, the injected Lua code executes within the Envoy proxy.</li>
<li>The injected Lua code attempts to read Envoy&rsquo;s xDS client credentials from the filesystem.</li>
<li>The attacker uses the obtained xDS client credentials to read all Contour xDS configuration, including TLS certificates and private keys of other tenants, or to cause a denial of service for other tenants sharing the Envoy instance.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful exploit allows attackers to execute arbitrary code within the Envoy proxy, potentially leading to credential theft and denial of service. Specifically, an attacker can steal TLS certificates and private keys of other tenants within the Contour environment. This could compromise sensitive data and disrupt services. If xDS credentials can be obtained, an attacker can then modify/exfiltrate service mesh configuration details.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Contour to version v1.33.4, v1.32.5, or v1.31.6 to remediate the Lua code injection vulnerability as described in the overview.</li>
<li>Monitor HTTPProxy resource creation and modification events for suspicious patterns or unexpected values in the <code>spec.routes[].cookieRewritePolicies[].pathRewrite.value</code> and <code>spec.routes[].services[].cookieRewritePolicies[].pathRewrite.value</code> fields.</li>
<li>Implement RBAC least privilege principles to restrict access to creating and modifying <code>HTTPProxy</code> resources, mitigating the initial access vector required to exploit this vulnerability.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>contour</category><category>lua</category><category>code-injection</category><category>httpproxy</category><category>cve-2026-41246</category></item></channel></rss>