/

CVE-2026-61559

Severity:

CRITICAL RISK

(9.6)

SSRF (CWE-918) in @zereight/mcp-gitlab API Service

CVE-2026-61559

Deferred

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Credential Disclosure and Unauthorized Outbound Requests

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A server-side request forgery vulnerability in @zereight/mcp-gitlab allows a caller to redirect outbound GitLab API requests to an arbitrary URL when dynamic API URLs are enabled. Because the server includes the victim's Private-Token in those requests, an attacker-controlled endpoint may receive the token.

Affected context

The issue occurs in deployments of @zereight/mcp-gitlab that enable ENABLE_DYNAMIC_API_URL=true and expose the server's HTTP transport to callers. In this configuration, the X-GitLab-API-URL request header can influence the destination used for GitLab API calls. A well-formed URL is accepted without restricting its scheme, hostname, or network location, allowing requests to reach destinations outside the intended GitLab service.

Exploit preconditions

  • Attack surface: The server's reachable HTTP transport
  • Required access: Ability to submit requests and set the X-GitLab-API-URL header
  • Trigger point: A subsequent GitLab API operation that performs an outbound fetch
  • Why exploitation is possible: URL syntax validation does not establish that the destination is trusted, while the server attaches the configured Private-Token to the redirected request

Why this happens

The vulnerability results from treating a caller-controlled URL as a trusted API endpoint. Although the value is parsed to confirm that it is well-formed, the implementation does not enforce an allowlist or hostname restriction before using it for authenticated outbound requests. This maps to CWE-918, Server-Side Request Forgery, because attacker-influenced input controls a server-side request destination and can cause sensitive authentication material to be sent to an unintended host.

Potential impact

  • An attacker may obtain the victim's GitLab Private-Token.
  • Unauthorized parties could use the exposed token to access GitLab resources within its permissions.
  • The server may be abused to send authenticated requests to attacker-controlled or otherwise unintended destinations.
  • Internal services or cloud metadata endpoints could be exposed if reachable from the server's network.

General mitigation guidance

Mitigation generally focuses on removing caller control over authenticated

API destinations and reducing the trust granted to dynamic URL settings.

Common defensive patterns include:

  • Disable dynamic API URL selection unless it is required.
  • Permit only explicitly configured GitLab hosts and approved URL schemes.
  • Resolve and validate destinations against an allowlist before each outbound request.
  • Prevent redirects from escaping the approved destination or reusing credentials across hosts.
  • Keep authentication tokens scoped to the minimum required permissions and avoid forwarding them to untrusted endpoints.
  • Apply egress network controls that restrict access to approved services.
  • Treat request headers as untrusted input and enforce authorization at the HTTP transport boundary.

How teams detect issues like this

Organizations can identify similar risks through:

  • Static analysis for request headers or user input flowing into URL, HTTP client, or fetch APIs.
  • Code review checks for dynamic endpoint configuration without hostname, scheme, or network-range validation.
  • Tests confirming that authenticated requests reject unapproved hosts, local addresses, metadata endpoints, and unexpected redirects.
  • Runtime logging and alerting for outbound requests whose destinations differ from the configured GitLab service.
  • Policy enforcement requiring explicit egress allowlists for services that handle API credentials.
  • Automated security review tools that flag SSRF data flows and credential forwarding across host boundaries.

Sources

SourceLink
github.comgithub.com/zereight/gitlab-mcp/commit/6ffb4cc70706fd05b1ab80901676bc2998b6db6d
github.comgithub.com/zereight/gitlab-mcp/pull/625
github.comgithub.com/zereight/gitlab-mcp/releases/tag/v2.1.27
github.comgithub.com/zereight/gitlab-mcp/security/advisories/GHSA-2h44-8472-frjj

Frequently asked

questions

Yes, when the MCP server's HTTP transport is reachable and dynamic API

endpoint selection is enabled. A caller must be able to supply the

request header that controls the outbound destination.

The attacker generally does not need to know the token in advance. The

server's configured Private-Token is sent with the redirected request, which

can allow an attacker-controlled host to capture it.

Do not allow request data to select authenticated outbound destinations.

If dynamic endpoints are necessary, enforce a strict allowlist and prevent

credentials from being sent to any unapproved host or redirect target.

Treat all endpoint values and headers as untrusted, apply destination and

egress controls, use least-privilege tokens, and test authenticated HTTP

clients against SSRF and redirect scenarios.

Find out what's already
exploitable in your codebase.