Skip to content

AAK-AZURE-MCP-NOAUTH-001

Azure MCP server published without auth middleware on /mcp/* routes

Field Value
Severity HIGH
Category MCP_CONFIG
Shipped v0.3.6
Scanner agent_audit_kit/scanners/mcp_server_auth.py
CWE CWE-306
OWASP MCP MCP07:2025 (Insufficient Authentication & Authorization)
OWASP Agentic ASI03 (Identity and Privilege Abuse)
AICM IAM-01, IAM-16
CVE CVE-2026-32211 (CVSS 9.1)
Sister rule AAK-AZURE-MCP-001 (consumer-side)

What it catches

Repository publishes an Azure-MCP-shaped server (@azure/mcp-server, azure-mcp-server Python package, or mcp-server-azure keywords in pyproject.toml / package.json) and exposes one or more /mcp/* route handlers (FastAPI / Flask / Express / Fastify / Hono) without an auth marker (@require_auth, verify_jwt, DefaultAzureCredential, Authorization header check, mTLS, passport.authenticate, bearerStrategy) anywhere in the same file.

Why a sister rule

v0.3.5's AAK-AZURE-MCP-001 detects the consumer side: agents whose .mcp.json points at an Azure MCP endpoint without auth. This rule is the upstream pair so server authors ship secure defaults.

Remediation

Add an auth middleware to every /mcp/* route:

from fastapi import FastAPI, Header

app = FastAPI()

@app.post("/mcp/tools/run")
async def run_tool(payload: dict, Authorization: str = Header(...)) -> dict:
    verify_jwt(Authorization)
    return {"ok": True, "result": payload}

Reject unauthenticated requests with HTTP 401 before dispatching to the MCP handler. Prefer Azure-AD managed identities or workload identity federation over static API keys.


Registry reference

This section is generated from the rule registry (agent_audit_kit/rules/builtin.py) when the documentation is built, so it follows the scanner. The rest of the page is hand-written; where the two disagree, the registry is what runs.

Severity
HIGH
Category
MCP Configuration (mcp-config)
Scanner
agent_audit_kit/scanners/mcp_server_auth.py
Auto-fixable
No.
SARIF name
AzureMcpServerNoAuth

What it detects

Repository publishes an Azure-MCP-shaped server (@azure/mcp-server, azure-mcp-server Python package, or mcp-server-azure keywords in pyproject.toml / package.json) and exposes one or more /mcp/* route handlers without an auth middleware on the same route. CVE-2026-32211 (CVSS 9.1) is the server-side default that AAK-AZURE-MCP-001 catches on the consumer side; this rule is the upstream pair so server authors ship secure defaults.

How to fix

Add an auth middleware to every /mcp/* route — Azure-AD JWT validation, client_credentials, mTLS, or a vault-issued API key checked at request time. Reject unauthenticated requests with HTTP 401 before dispatching to the MCP handler.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-AZURE-MCP-NOAUTH-001

Limitations

Runs only when the root pyproject.toml, package.json, Cargo.toml or pom.xml contains @azure/mcp-server, mcp-server-azure, mcp.azurewebsites.net or azure, mcp and server joined by -, _ or nothing (azure-mcp-server, azure_mcp_server, azuremcpserver), in any case. It then looks for /mcp routes, written as @app, @router or @api decorators in Python and as app, router, server, api or fastify calls such as app.post(...) in TypeScript and JavaScript, and skips any file that contains an auth marker anywhere. DefaultAzureCredential is such a marker, so a server that only uses its own credential to call Azure, and authenticates nobody who calls it, passes, and so does a route on an object with another name, such as a Flask blueprint called bp. A source file over 512 KB, or a manifest over 2 MB, is not read.

References


All rules.