/

CVE-2026-61560

Severity:

CRITICAL RISK

(9.8)

Path Traversal (CWE-22) in @zereight MCP GitLab Server

CVE-2026-61560

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read and Credential Theft

Severity:

CRITICAL RISK

(9.8)

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 path traversal vulnerability in the upload_markdown tool of @zereight/mcp-gitlab can allow unauthenticated attackers to read arbitrary files from the server when SSE transport is enabled without authentication. An attacker may use the exposed tool to obtain sensitive environment data, including a GitLab personal access token, potentially enabling full GitLab account takeover.

Affected context

The vulnerability can occur in deployments that enable the MCP server's SSE transport mode with SSE=true while leaving MCP tools accessible without authentication. It is especially relevant to containerized deployments where sensitive credentials are provided through environment variables and the upload_markdown tool accepts file paths without effective confinement to an approved directory.

Exploit preconditions

  • Attack surface: Network-reachable MCP SSE endpoint
  • Required access: No authentication may be required when the affected SSE configuration is enabled
  • Trigger point: Invocation of the upload_markdown tool with a crafted file_path value
  • Why exploitation is possible: The file path is insufficiently restricted, allowing access outside the intended content directory; retrieved files may then be uploaded to a GitLab project
  • Additional condition: Sensitive credentials must be present in readable server files or environment-backed process data

Why this happens

The underlying bug is improper restriction of user-controlled filesystem paths. The upload_markdown tool uses an unsanitized file_path parameter, allowing path traversal beyond the intended file boundary and causing arbitrary local file disclosure.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The unauthenticated exposure of the tool increases the reachable attack surface, while storing a GitLab personal access token in process environment data can turn file disclosure into credential compromise.

Potential impact

  • An attacker may read sensitive local files from the MCP server
  • GitLab personal access tokens may be disclosed
  • A stolen token could enable GitLab account or project compromise
  • Attackers could modify repositories, pipelines, issues, or other accessible resources
  • Exposed credentials could support further lateral movement or supply-chain attacks

General mitigation guidance

Mitigation generally focuses on enforcing authentication and applying strict filesystem boundaries to tool inputs.

Common defensive patterns include:

  • Require authentication and authorization for every MCP tool exposed through SSE
  • Resolve requested paths and verify that they remain within an explicitly allowed directory
  • Prefer file identifiers or server-managed objects over raw client-supplied filesystem paths
  • Reject traversal components, symbolic-link escapes, absolute paths, and unexpected path encodings
  • Avoid exposing process environment files and keep access tokens outside broadly readable runtime locations where practical
  • Use narrowly scoped GitLab tokens with minimum required permissions and short lifetimes
  • Run the service with a dedicated low-privilege identity and a restricted, preferably read-only filesystem
  • Apply network access controls so the MCP endpoint is not unnecessarily reachable

How teams detect issues like this

Organizations can look for:

  • Static analysis findings involving filesystem APIs that consume unsanitized tool or request parameters
  • Code review signals such as raw path concatenation, missing canonicalization, and absent containment checks
  • MCP tool definitions that expose file reads or uploads without authentication and authorization requirements
  • Runtime logs showing unauthenticated SSE tool calls, traversal-like path components, or unexpected file access
  • Network monitoring for exposure of MCP endpoints beyond trusted administrative networks
  • Secret-scanning and policy checks for overly broad GitLab token scopes or credentials exposed through environment variables

Automated application-security and dependency-review tools may help identify related patterns, but they should complement targeted review of tool authorization and filesystem boundaries.

Sources

SourceLink
github.comgithub.com/zereight/gitlab-mcp/pull/482
github.comgithub.com/zereight/gitlab-mcp/pull/554
github.comgithub.com/zereight/gitlab-mcp/pull/622
github.comgithub.com/zereight/gitlab-mcp/security/advisories/GHSA-cv3r-c5h8-f4g5

Frequently asked

questions

Yes, where the SSE endpoint is network reachable and MCP tools are exposed without authentication. The attacker does not necessarily need an existing account on the service.

The primary requirement is network access to the unauthenticated SSE endpoint. The attacker also needs the vulnerable tool to accept and process the supplied file path.

Require authentication and authorization for tool calls, then enforce canonical path resolution and strict containment within an approved directory. Avoid allowing clients to submit arbitrary server filesystem paths.

Apply least privilege to service accounts and tokens, restrict endpoint exposure, use secure file-handling abstractions, and test tool inputs for traversal, symlink escapes, and unauthorized file disclosure.

Find out what's already
exploitable in your codebase.