Dev.to Security 🔐 Cybersecurity 👁 0 📖 3 min read

CVE-2026-137187: CVE-2026-137187: Fail-Open Project Allowlist Authorization Bypass in @zereight/mcp-gitlab

CVE-2026-137187: Fail-Open Project Allowlist Authorization Bypass in @zereight/mcp-gitlab Vulnerability ID: CVE-2026-137187 CVSS Score: 5.4 Published: 2026-12-01 CVE-2026-137187 (GHSA-5xhm-p3jx-2fmc) is a missing au

CVE-2026-137187: Fail-Open Project Allowlist Authorization Bypass in @zereight/mcp-gitlab

Vulnerability ID: CVE-2026-137187
CVSS Score: 5.4
Published: 2026-12-01

CVE-2026-137187 (GHSA-5xhm-p3jx-2fmc) is a missing authorization vulnerability (CWE-862) in @zereight/mcp-gitlab affecting versions 2.2.5 through 2.3.6. The flaw exists within the gitlab_api_request tool, where project allowlist enforcement fails open when evaluating API paths that do not conform to the /projects/:id pattern or when following HTTP redirects to an empty relative path. Attackers or compromised LLM agents with access to the api toolset can bypass project isolation boundaries to query or modify group, user, and instance-level GitLab resources permitted by the server's underlying authentication token.

TL;DR

The gitlab_api_request tool in @zereight/mcp-gitlab versions >= 2.2.5 and < 2.3.7 silently skips project allowlist validation for any GitLab REST API route lacking a parseable project ID (such as /groups, /users, /search, or /admin), allowing callers to bypass configured project scope restrictions.

⚠️ Exploit Status: POC

Technical Details

  • CVE / GHSA ID: CVE-2026-137187 / GHSA-5xhm-p3jx-2fmc
  • Vulnerability Class: CWE-862: Missing Authorization (Fail-Open Allowlist)
  • CVSS v3.1 Score: 5.4 Medium (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N)
  • Affected Component: @zereight/mcp-gitlab tools/gitlab-api-request.ts (gitlab_api_request)
  • Vulnerable Versions: >= 2.2.5, < 2.3.7 (Fixed in 2.3.7)
  • Attack Vector: Network via MCP tool invocation using non-project API paths (e.g., /groups, /search, /users)
  • Exploit & KEV Status: PoC in unit tests; Not listed in CISA KEV

Affected Systems

  • @zereight/mcp-gitlab (npm package / Model Context Protocol server for GitLab)
  • @zereight/mcp-gitlab: >= 2.2.5, < 2.3.7 (Fixed in: 2.3.7)

Code Analysis

Commit: 9faa3be

fix(api): refuse non-project paths in gitlab_api_request when a project allowlist is set

@@ -168,9 +168,13 @@ function assertRedirectedApiPathAllowed(
   if (allowlist.length === 0) {
     return;
   }
-  if (relative === undefined || relative.length === 0) {
+  // Only an untrusted cross-origin hop is left here, and it carries no credentials.
+  if (relative === undefined) {
     return;
   }
+  if (relative.length === 0) {
+    throw notProjectScopedError(allowlist);
+  }
   let normalized: string;
   try {
     normalized = normalizeGitLabApiRelativePath(relative);
@@ -181,6 +185,18 @@ function assertRedirectedApiPathAllowed(
   assertProjectAllowlist(normalized, allowlist);
 }

+function notProjectScopedError(allowlist: readonly string[]): GitLabApiRequestInputError {
+  return new GitLabApiRequestInputError(
+    `Access denied: gitlab_api_request path is not scoped to a project in the allowed project list: ${allowlist.join(", ")}. ` +
+      "Only /projects/:id and /projects/:id/... paths are allowed while a project allowlist is in effect"
+  );
+}
+
+/**
+ * With an allowlist, the path must be `projects/:id` or `projects/:id/...` for an
+ * allowed project. Any other path (groups, users, search, admin, the projects
+ * collection, or a route this parser does not recognize) is refused.
+ */
 function assertProjectAllowlist(relativePath: string, allowlist: readonly string[]): void {
   if (allowlist.length === 0) {
     return;
@@ -193,7 +209,7 @@ function assertProjectAllowlist(relativePath: string, allowlist: readonly string
     throw new GitLabApiRequestInputError(message);
   }
   if (projectId === undefined) {
-    return;
+    throw notProjectScopedError(allowlist);
   }
   const rawSegment = relativePath.split("/")[1] ?? projectId;
   if (!projectAllowed(projectId, rawSegment, allowlist)) {

Mitigation Strategies

  • Upgrade @zereight/mcp-gitlab to version 2.3.7 or later to enforce fail-closed project allowlist validation.
  • Disable the raw REST API escape hatch by omitting the 'api' toolset from the GITLAB_TOOLSETS configuration.
  • Replace broad Personal Access Tokens (PATs) with narrowly scoped GitLab Project Access Tokens limited to the specific target project.
  • Enable read-only mode (GITLAB_PERMISSION_MODE=readonly) when write operations are not required by the MCP agent.

Remediation Steps:

  1. Audit MCP server configuration files (such as claude_desktop_config.json, cursor settings, or container environment manifests) to check if @zereight/mcp-gitlab is deployed with GITLAB_TOOLSETS including 'api'.
  2. Update the @zereight/mcp-gitlab package dependency or npx execution target to version 2.3.7 or newer.
  3. Restart all running @zereight/mcp-gitlab server processes to load the patched tool definitions.
  4. Review GitLab audit logs and API access logs for unexpected calls to /api/v4/groups, /api/v4/search, /api/v4/users, or /api/v4/admin originating from the MCP server's token, and rotate GITLAB_TOKEN if unauthorized access is suspected.

References

Read the full report for CVE-2026-137187 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.