vulnerableVerifiedAGT-2026-0176
@zereight/mcp-gitlab: DNS rebinding reaches local Streamable HTTP MCP transport
A real bug in otherwise honest software. Check your version against the affected range below.
GHSA-vmp7-252j-cwp7 · CVE-2026-61568
`@zereight/mcp-gitlab` exposes its Streamable HTTP MCP endpoint without an effective Host or Origin allowlist. A malicious web page can use DNS rebinding to route browser requests to a victim's local MCP listener while preserving an attacker-controlled `Host` and `Origin`. The server accepts those headers and reaches the MCP initialization path instead of rejecting the request at the HTTP boundary.
This is CWE-350, Reliance on Reverse DNS Resolution for a Security-Critical Action. The affected package is `@zereight/mcp-gitlab` version `2.1.18` at commit `74a8c834424ff557ad8bc6f225e4dc5acf80aa13`.
The vulnerable transport setup is in `index.ts`. Express JSON parsing is installed globally before any MCP route-level Host or Origin allowlist:
```typescript // index.ts:12077 app.use(express.json());
registerDownloadProxy(app); ```
The Streamable HTTP transport is then created without the SDK DNS-rebinding controls:
```typescript // index.ts:12375 transport = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID(), onsessioninitialized: (newSessionId: string) => { streamableTransports[newSessionId] = transport; metrics.totalSessions++; metrics.activeSessions++; }, }); ```
The transport constructor does not set `enableDnsRebindingProtection`, `allowedHosts`, or `allowedOrigins`. The server also does not add an Express middleware that rejects unexpected `Host` or `Origin` headers before `/mcp`.
The default host is loopback, which is the exact target DNS rebinding attacks are designed to reach:
```typescript // config.ts:192 export const HOST = getConfig("host", "HOST") || "127.0.0.1";
// config.ts:196 export const PORT = _intEnv("PORT", "port", _PORT_DEFAULT); ```
The README documents Streamable HTTP as a supported transport for modern remote deployments and documents `REMOTE_AUTHORIZATION=true` for multi-user HTTP deployments. In that mode, unauthenticated `tools/list` and material GitLab API tool calls are blocked by token checks. The Host/Origin defect is still present at the browser boundary: the server accepts attacker-controlled browser-origin headers and processes the MCP `initialize` request instead of rejecting the connection as cross-origin localhost access.
Proof of concept
The following reproduction uses a fake GitLab API with planted data. It proves the HTTP boundary failure and the token boundary separately:
- no-token `initialize` succeeds with attacker-controlled `Host` and `Origin`; - no-token `tools/list` is rejected with `401`; - the same forged-origin flow with a planted `Private-Token` lists tools and calls `list_project_variables`; - the fake GitLab API records the forwarded token and returns a planted fake project variable.
Start the fake GitLab API:
```bash python3 - <<'PY' import json from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from urllib.parse import parse_qs, urlparse
WITNESS = "/tmp/zereight-gitlab-mcp-rebind-witness.jsonl" PROJECT_ID = "pluto/rebind-target" FAKE_SECRET = "glpat-FAKE-PROJECT-CI-SECRET-0001"
class Handler(BaseHTTPRequestHandler): def _json(self, status, payload): data = json.dumps(payload).encode() self.send_response(status) self.send_header("Content-Type", "application/json") self.send_header("Content-Length", str(len(data))) self.end_headers() self.wfile.write(data)
def _record(self): parsed = urlparse(self.path) with open(WITNESS, "a", encoding="utf-8") as f: f.write(json.dumps({ "method": self.command, "path": parsed.path, "query": parse_qs(parsed.query), "authorization": self.headers.get("authorization"), "private_token": self.headers.get("private-token"), "job_token": self.headers.get("job-token"), }, sort_keys=True) + "\n")
def do_GET(self): self._record() path = urlparse(self.path).path
Imported from OSV GHSA-vmp7-252j-cwp7.
Affected
- npm:@zereight/mcp-gitlab
- < 2.1.30 (fixed in 2.1.30)
Field marks
- Kind
- mcp server
- Reported by
- osv-import
Sources
- osv.dev https://osv.dev/vulnerability/GHSA-vmp7-252j-cwp7
- github.com https://github.com/zereight/gitlab-mcp/security/advisories/GHSA-vmp7…
- github.com https://github.com/zereight/gitlab-mcp/pull/555
- github.com https://github.com/zereight/gitlab-mcp/commit/52207c6f5c0e7a39e9235d…
- github.com https://github.com/zereight/gitlab-mcp
- github.com https://github.com/zereight/gitlab-mcp/releases/tag/v2.1.30
Wrong or outdated? Open an issue or PR against corpus/entries/AGT-2026-0176.json.