<?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>Sse — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/sse/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 26 Jan 2024 18:47:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/sse/feed.xml" rel="self" type="application/rss+xml"/><item><title>GitLab MCP Server Unauthenticated Access via SSE Transport</title><link>https://feed.craftedsignal.io/briefs/2024-01-26-gitlab-mcp-server-auth-bypass/</link><pubDate>Fri, 26 Jan 2024 18:47:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-26-gitlab-mcp-server-auth-bypass/</guid><description>The @yoda.digital/gitlab-mcp-server's SSE transport lacks authentication and uses wildcard CORS, enabling unauthenticated attackers to execute arbitrary GitLab API calls using the operator's GitLab PAT, including destructive operations.</description><content:encoded><![CDATA[<p>The <code>@yoda.digital/gitlab-mcp-server</code> exposes an unauthenticated SSE HTTP transport that allows anyone who can reach the server&rsquo;s port to execute arbitrary GitLab API calls with the operator&rsquo;s <code>GITLAB_PERSONAL_ACCESS_TOKEN</code>. This vulnerability exists because the server does not require any authentication for the <code>/sse</code> and <code>/messages</code> endpoints and uses a wildcard CORS policy, effectively allowing any website visited by the operator to interact with the server. This allows attackers to perform destructive operations such as deleting repositories or pushing malicious files. The issue was identified in commit <code>80a7b4cf3fba6b55389c0ef491a48190f7c8996a</code> of the <code>mcp-gitlab-server</code> and affects versions prior to 0.6.0.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker identifies a vulnerable <code>@yoda.digital/gitlab-mcp-server</code> instance running with <code>USE_SSE=true</code> enabled.</li>
<li>The attacker crafts a malicious web page that, when visited by the operator, attempts to connect to the <code>/sse</code> endpoint of the GitLab MCP server.</li>
<li>Due to the wildcard CORS policy (<code>Access-Control-Allow-Origin: *</code>), the browser allows the cross-origin request from the malicious page to succeed.</li>
<li>The server establishes an SSE connection and provides the attacker with a session ID in the form of <code>/messages?sessionId=&lt;UUID&gt;</code>.</li>
<li>The attacker&rsquo;s malicious web page sends a POST request to the <code>/messages?sessionId=&lt;UUID&gt;</code> endpoint, specifying a <code>tools/call</code> method with a desired GitLab API function (e.g., <code>delete_repository</code>, <code>push_files</code>).</li>
<li>The server receives the unauthenticated request and, using the operator&rsquo;s <code>GITLAB_PERSONAL_ACCESS_TOKEN</code>, executes the requested GitLab API call.</li>
<li>The attacker successfully deletes repositories, pushes malicious files, or modifies repository settings on the targeted GitLab instance.</li>
<li>The attacker achieves their objective, such as compromising the integrity of the GitLab instance or exfiltrating sensitive data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an unauthenticated attacker to perform arbitrary actions on a GitLab instance using the permissions of the operator&rsquo;s <code>GITLAB_PERSONAL_ACCESS_TOKEN</code>. This includes deleting repositories, pushing malicious code, and modifying repository settings. The impact is significant as it allows complete compromise of the targeted GitLab instance. The vulnerability affects any instance where the <code>@yoda.digital/gitlab-mcp-server</code> is running with <code>USE_SSE=true</code> and is network accessible, or when the operator visits a malicious webpage while running the server.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>As a short-term mitigation, if using SSE, immediately set the <code>MCP_GITLAB_AUTH_TOKEN</code> environment variable and validate that the server is checking this token on every request as suggested in the advisory to prevent unauthenticated access.</li>
<li>Limit network exposure by ensuring that the server is bound to <code>127.0.0.1</code> unless there&rsquo;s a specific requirement for network accessibility. Configure the <code>MCP_GITLAB_HOST</code> variable and use the <code>CORS_ORIGINS</code> allowlist as described in the advisory.</li>
<li>Upgrade to version 0.6.0 or later of <code>@yoda.digital/gitlab-mcp-server</code> when available to obtain the official fix and ensure that the SAML/OAuth3 authentication mechanisms described in the README are implemented to secure the SSE transport.</li>
<li>Deploy the Sigma rule &ldquo;Detect GitLab MCP Server Unauthenticated SSE Connection&rdquo; to detect connections to the <code>/sse</code> endpoint, indicating potential exploitation attempts.</li>
<li>Deploy the Sigma rule &ldquo;Detect GitLab MCP Server Unauthenticated API Call&rdquo; to detect unauthenticated calls to the <code>/messages</code> endpoint, indicating exploitation via the SSE transport.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>gitlab</category><category>auth-bypass</category><category>sse</category><category>cors</category><category>vulnerability</category></item></channel></rss>