SSRF Vulnerability in mcp-gitlab Enables GitLab Credential Theft
The mcp-gitlab server is vulnerable to Server-Side Request Forgery (SSRF) when ENABLE_DYNAMIC_API_URL is enabled, allowing attackers to force the server to forward victim GitLab tokens to an arbitrary host.
CVE search metadata
CVE search record: CVE-2026-61559. Severity: critical. CVSS: 9.6. KEV: no. Product: mcp-gitlab (>= 0.0.1, <= 2.1.27), mcp-gitlab (< 2.1.30), mcp-gitlab (< 2.1.27). Brief: SSRF Vulnerability in mcp-gitlab Enables GitLab Credential Theft. Brief link: https://feed.craftedsignal.io/briefs/2026-09-mcp-gitlab-ssrf/
What's new
The npm package @zereight/mcp-gitlab contains a critical SSRF vulnerability (CVE-2026-61559) in all versions through commit 74a8c83. When the configuration variable ENABLE_DYNAMIC_API_URL is set to true, the application blindly trusts the X-GitLab-API-URL HTTP header provided by a requester. The server validates that the header is a well-formed URL but fails to perform any allowlist check or hostname restriction against the destination.
As a result, an attacker can supply an arbitrary URL via this header. The server subsequently uses this URL for downstream GitLab API calls, attaching the victim's Private-Token header to the request before sending it to the attacker-controlled server. This flaw allows attackers to steal credentials and gain full authenticated access to the victim's GitLab account, including CI/CD variables, source code, and project management data. The vulnerability is reachable in multi-user deployment scenarios where REMOTE_AUTHORIZATION=true is enabled.
Attack Chain
- The target is running
mcp-gitlabwithENABLE_DYNAMIC_API_URL=trueandREMOTE_AUTHORIZATION=true. - The attacker initializes a listener on an external server capable of capturing HTTP headers.
- The attacker crafts a malicious request to the MCP server's tool execution endpoint.
- The attacker injects the
X-GitLab-API-URLheader pointing to their listener URL. - The MCP server process parses the malicious header and updates the API base URL for the current session.
- The server initiates a legitimate GitLab API call (e.g., to list issues) using the attacker-supplied URL.
- The server attaches the victim's
Private-Tokento the request, facilitating the SSRF-based exfiltration. - The attacker receives the victim's token via their listener and proceeds to exfiltrate or manipulate GitLab resources.
Impact
Successful exploitation results in full account compromise at the victim's permission level. Attackers can gain unauthorized access to all repositories, issues, and merge requests, as well as read and modify CI/CD pipelines, secrets, and environment variables. This represents a complete breach of the GitLab security domain for the affected user.
Recommendation
- If using
mcp-gitlabin a multi-user environment, disableENABLE_DYNAMIC_API_URLimmediately until a patched version is available. - Implement an allowlist for the
X-GitLab-API-URLheader by verifying the hostname against a hardcoded list of trusted GitLab instances before the request is processed. - Search web access logs for any incoming requests containing the
X-GitLab-API-URLheader to identify potential exploitation attempts. - Rotate all GitLab Personal Access Tokens and CI/CD job tokens for users who interacted with an affected instance of the MCP server.
Immediate actions
Disable ENABLE_DYNAMIC_API_URL in all production mcp-gitlab deployments
Enrichment needed
- CVE-2026-61559 (CTI) Monitor for exploit code availability.
Mitigations
Implement allowlist validation for X-GitLab-API-URL header
CVE-2026-61559
Detection coverage 1
Detect CVE-2026-61560 Exploitation - MCP GitLab upload_markdown abuse
criticalDetects unauthorized attempts to trigger the upload_markdown tool via the MCP GitLab API to exfiltrate sensitive files
Detection queries are available on the platform. Get full rules →