Skip to content
Threat Feed
critical advisory updated

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

  • 1. added detection rule: Detect CVE-2026-61560 Exploitation - MCP GitLab upload_markdown abuse Sep 16, 19:07 via ghsa
  • 2. added coverage for mcp-gitlab (< 2.1.30) Sep 16, 01:04 via ghsa

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

  1. The target is running mcp-gitlab with ENABLE_DYNAMIC_API_URL=true and REMOTE_AUTHORIZATION=true.
  2. The attacker initializes a listener on an external server capable of capturing HTTP headers.
  3. The attacker crafts a malicious request to the MCP server's tool execution endpoint.
  4. The attacker injects the X-GitLab-API-URL header pointing to their listener URL.
  5. The MCP server process parses the malicious header and updates the API base URL for the current session.
  6. The server initiates a legitimate GitLab API call (e.g., to list issues) using the attacker-supplied URL.
  7. The server attaches the victim's Private-Token to the request, facilitating the SSRF-based exfiltration.
  8. 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

  1. If using mcp-gitlab in a multi-user environment, disable ENABLE_DYNAMIC_API_URL immediately until a patched version is available.
  2. Implement an allowlist for the X-GitLab-API-URL header by verifying the hostname against a hardcoded list of trusted GitLab instances before the request is processed.
  3. Search web access logs for any incoming requests containing the X-GitLab-API-URL header to identify potential exploitation attempts.
  4. 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

IT Operations 24h

Enrichment needed

  • CVE-2026-61559 (CTI) Monitor for exploit code availability.

Mitigations

Implement allowlist validation for X-GitLab-API-URL header

immediate Detection Engineering

CVE-2026-61559

Detection coverage 1

Detect CVE-2026-61560 Exploitation - MCP GitLab upload_markdown abuse

critical

Detects unauthorized attempts to trigger the upload_markdown tool via the MCP GitLab API to exfiltrate sensitive files

sigma tactics: exfiltration techniques: T1005 sources: webserver

Detection queries are available on the platform. Get full rules →