GitLab MCP server ignores its own project allowlist
A GitHub advisory published on 1 December 2026 says @zereight/mcp-gitlab skips its allowlist check whenever it cannot find a project ID in an API path.
By The Agentic Times ·

A security advisory published on 1 December 2026 says the npm package @zereight/mcp-gitlab contains a flaw that lets callers slip past the project restrictions an operator has configured. The issue is tracked as CVE-2026-137187 under the GitHub advisory GHSA-5xhm-p3jx-2fmc.
The package is an MCP server, a tool that exposes an external service to an AI agent through the Model Context Protocol. One of the tools it offers, gitlab_api_request, lets a caller send requests to arbitrary paths under GitLab's /api/v4 interface. To limit the damage that could do, the server supports a per-project allowlist called allowedProjectIds, which is meant to confine the caller to a known set of GitLab projects.
According to the advisory, that confinement does not hold. The checking function, assertProjectAllowlist, first tries to pull a project ID out of the requested path, then compares it against the allowlist. If the extraction fails and returns undefined, the function simply returns without performing any check. In other words, "could not identify a project" is treated as "allow" rather than "deny".
The practical effect is that any API path the parser does not recognise as project-scoped passes straight through. The advisory gives several examples: group-level endpoints under /groups/, instance-level and administrative endpoints, user-level endpoints, and any future GitLab API surface the parser has not been taught about. The advisory says the same early return appears on the redirect-revalidation path, assertRedirectedApiPathAllowed, which also exits without checking when the relative path is empty or does not resolve to a recognised project segment. Both the initial request and the redirect follow-up are therefore affected.
The advisory frames the impact in terms of operator expectations. An administrator who sets allowedProjectIds specifically to pen a caller into a handful of projects "gets no actual confinement for any GitLab API surface outside that one path-shape". The tool's own design implies otherwise, the advisory notes, pointing to its error message, "Access denied: Project X is not in the allowed project list", which suggests the allowlist is a genuine boundary.
The advisory's suggested fix is to fail closed. That means denying a request when no project ID can be extracted from the path, instead of waving it through. As an alternative, the advisory says maintainers could explicitly enumerate and allowlist the non-project-scoped endpoints the tool is actually intended to expose, so that group and instance endpoints are permitted only by deliberate choice.
The finding came from static analysis of the public repository, with the reviewer examining the current main branch as of 21 October 2026. The advisory states plainly that the behaviour was not tested against a live GitLab instance, so the report rests on reading the code rather than on an observed exploit. There is no indication in the advisory of real-world abuse.
The pattern is a familiar one for MCP servers that wrap a broad API behind a narrow-sounding permission control. The guard exists, but it only inspects one shape of request. Everything the parser does not understand is, by default, allowed. Operators relying on allowedProjectIds should treat it as a partial filter rather than a boundary until the behaviour changes.
Sources
- github.comhttps://github.com/advisories/GHSA-5xhm-p3jx-2fmc
