<?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>Litellm — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/litellm/</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>Fri, 08 Nov 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/litellm/feed.xml" rel="self" type="application/rss+xml"/><item><title>LiteLLM Proxy API Key Verification SQL Injection</title><link>https://feed.craftedsignal.io/briefs/2024-11-litellm-sqli/</link><pubDate>Fri, 08 Nov 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-11-litellm-sqli/</guid><description>A SQL injection vulnerability exists in LiteLLM versions 1.81.16 to prior to 1.83.7 allowing an unauthenticated attacker to inject SQL queries via a crafted 'Authorization' header, potentially leading to unauthorized data access or modification.</description><content:encoded><![CDATA[<p>A critical SQL injection vulnerability has been identified in LiteLLM, specifically affecting versions 1.81.16 through 1.83.6. The vulnerability resides within the proxy API key verification process. Due to improper sanitization of the <code>Authorization</code> header, an unauthenticated attacker can inject arbitrary SQL commands. This is achieved by sending a specially crafted header to any LLM API route, such as <code>POST /chat/completions</code>, which triggers the vulnerable query through the proxy&rsquo;s error-handling mechanism. Defenders should prioritize patching to version 1.83.7 or later to mitigate this risk, or implement the suggested workaround.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker sends a crafted HTTP <code>Authorization</code> header to a LiteLLM API endpoint (e.g., <code>/chat/completions</code>).</li>
<li>The LiteLLM proxy receives the request and extracts the API key from the <code>Authorization</code> header.</li>
<li>Due to insufficient sanitization, the API key value is directly concatenated into a SQL query string.</li>
<li>The vulnerable SQL query is executed against the proxy&rsquo;s database.</li>
<li>The attacker injects SQL code to read sensitive data, such as user credentials or API keys, from the database.</li>
<li>The attacker may further inject SQL code to modify data, potentially granting themselves administrative privileges or compromising other users&rsquo; accounts.</li>
<li>The attacker gains unauthorized access to the LiteLLM proxy.</li>
<li>The attacker leverages the compromised proxy to access and control connected LLMs, exfiltrate data, or disrupt services.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this SQL injection vulnerability can lead to complete compromise of the LiteLLM proxy. Attackers could read or modify sensitive data within the proxy&rsquo;s database, including API keys and credentials. This could lead to unauthorized access to managed LLMs and potentially allow attackers to exfiltrate sensitive data, disrupt services, or gain a foothold for further attacks within the compromised environment. The impact is significant due to the potential for widespread data breaches and service disruptions.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade LiteLLM to version 1.83.7 or later to patch the SQL injection vulnerability as detailed in the advisory <a href="https://github.com/advisories/GHSA-r75f-5x8p-qvmc">GHSA-r75f-5x8p-qvmc</a>.</li>
<li>If upgrading is not immediately feasible, set <code>disable_error_logs: true</code> in the <code>general_settings</code> configuration to mitigate the risk as described in the advisory <a href="https://github.com/advisories/GHSA-r75f-5x8p-qvmc">GHSA-r75f-5x8p-qvmc</a>.</li>
<li>Monitor web server logs for suspicious <code>Authorization</code> headers containing SQL injection payloads to detect potential exploitation attempts. Deploy the provided Sigma rule targeting HTTP request patterns.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>sqli</category><category>litellm</category><category>web-application</category></item><item><title>LiteLLM Server-Side Template Injection Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-11-litellm-ssti/</link><pubDate>Tue, 05 Nov 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-11-litellm-ssti/</guid><description>A server-side template injection vulnerability in LiteLLM versions 1.80.5 to before 1.83.7 allows authenticated users to execute arbitrary code within the LiteLLM Proxy process via a crafted prompt template, potentially exposing sensitive information and enabling command execution on the host.</description><content:encoded><![CDATA[<p>A server-side template injection (SSTI) vulnerability has been identified in LiteLLM versions 1.80.5 up to, but not including, 1.83.7. This flaw resides within the <code>/prompts/test</code> endpoint, which processes user-supplied prompt templates. Due to insufficient input sanitization, a malicious actor with a valid proxy API key can inject arbitrary code into the template, leading to its execution within the LiteLLM Proxy process. This vulnerability was disclosed on April 24, 2026. Successful exploitation can compromise the proxy&rsquo;s environment, potentially exposing sensitive credentials like provider API keys and database passwords, or allowing arbitrary command execution on the host system. Organizations using affected versions of LiteLLM are at risk. The vulnerability is addressed in version 1.83.7-stable by implementing a sandboxed template renderer.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker authenticates to the LiteLLM proxy server using a valid API key.</li>
<li>The attacker crafts a malicious prompt template containing SSTI payloads.</li>
<li>The attacker sends a POST request to the <code>/prompts/test</code> endpoint, including the crafted template in the request body.</li>
<li>The LiteLLM proxy server receives the request and processes the template without proper sanitization.</li>
<li>The SSTI payload executes arbitrary code within the LiteLLM proxy process.</li>
<li>The attacker gains access to environment variables containing sensitive information, such as API keys and database credentials.</li>
<li>The attacker uses the exposed credentials to gain unauthorized access to external services or data.</li>
<li>The attacker executes arbitrary commands on the host system, potentially leading to full system compromise.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this SSTI vulnerability allows attackers to execute arbitrary code within the LiteLLM Proxy process. This can lead to the exposure of sensitive information such as API keys and database credentials, potentially enabling unauthorized access to other systems and data. Furthermore, attackers can execute arbitrary commands on the host, leading to full system compromise. The impact is significant for organizations relying on LiteLLM for managing and routing AI model requests, as it could result in data breaches, service disruption, and reputational damage.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade LiteLLM to version <code>1.83.7-stable</code> or later to patch the vulnerability, as this version implements a sandboxed template renderer (see Patches).</li>
<li>As a temporary workaround, block <code>POST /prompts/test</code> at your reverse proxy or API gateway to prevent exploitation attempts (see Workarounds).</li>
<li>Review and rotate API keys that should not have access to prompt management routes to limit the potential impact of compromised keys (see Workarounds).</li>
<li>Deploy the Sigma rule &ldquo;Detect LiteLLM SSTI Attempts via /prompts/test&rdquo; to your SIEM to identify potential exploitation attempts based on HTTP request patterns.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>ssti</category><category>litellm</category><category>template-injection</category><category>code-execution</category></item><item><title>LiteLLM Authenticated Command Execution via MCP stdio Test Endpoints</title><link>https://feed.craftedsignal.io/briefs/2024-01-litellm-rce/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-litellm-rce/</guid><description>Authenticated users with low-privilege API keys could execute arbitrary commands on the host running LiteLLM via the `/mcp-rest/test/connection` and `/mcp-rest/test/tools/list` endpoints, by submitting a server configuration including command execution parameters.</description><content:encoded><![CDATA[<p>LiteLLM versions 1.74.2 through 1.83.6 are vulnerable to authenticated command execution. Two endpoints, <code>POST /mcp-rest/test/connection</code> and <code>POST /mcp-rest/test/tools/list</code>, intended for previewing MCP server configurations, allowed any authenticated user to execute arbitrary commands on the proxy host. This was possible because the endpoints accepted a full server configuration in the request body, including the <code>command</code>, <code>args</code>, and <code>env</code> fields used by the stdio transport, without proper role checks. An attacker could exploit this vulnerability by using a low-privilege API key to send a crafted request containing malicious commands, leading to command execution with the privileges of the proxy process. The vulnerability was patched in version 1.83.7 by enforcing the <code>PROXY_ADMIN</code> role for these endpoints.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker authenticates to the LiteLLM proxy with a valid, but low-privilege, API key.</li>
<li>Attacker crafts a malicious JSON payload containing a server configuration intended for the stdio transport. The payload includes the <code>command</code>, <code>args</code>, and <code>env</code> fields, which specify the command to be executed, its arguments, and environment variables, respectively.</li>
<li>Attacker sends a <code>POST</code> request to either the <code>/mcp-rest/test/connection</code> or <code>/mcp-rest/test/tools/list</code> endpoint, with the malicious JSON payload in the request body.</li>
<li>The LiteLLM proxy receives the request and, due to the vulnerability, attempts to connect to the supplied server configuration.</li>
<li>The proxy spawns the supplied command as a subprocess on the proxy host, using the privileges of the proxy process.</li>
<li>The attacker-supplied command executes arbitrary code on the host.</li>
<li>The attacker gains control of the proxy host with the privileges of the LiteLLM proxy.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to execute arbitrary commands on the host running the LiteLLM proxy. Since the vulnerability can be exploited with a low-privilege API key, this significantly broadens the attack surface. Depending on the privileges of the proxy process, this could lead to full system compromise, data exfiltration, or denial of service. The lack of specific victim count or sector targeting information in the advisory suggests a broad potential impact across various deployments of LiteLLM.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade LiteLLM to version 1.83.7 or later to remediate the vulnerability (see Patches).</li>
<li>As a temporary workaround, block <code>POST</code> requests to the <code>/mcp-rest/test/connection</code> and <code>/mcp-rest/test/tools/list</code> endpoints at your reverse proxy or API gateway (see Workarounds).</li>
<li>Monitor web server logs for <code>POST</code> requests to <code>/mcp-rest/test/connection</code> and <code>/mcp-rest/test/tools/list</code> endpoints, looking for suspicious <code>command</code>, <code>args</code>, and <code>env</code> parameters in the request body (see rules below).</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>rce</category><category>litellm</category><category>command-injection</category></item></channel></rss>