Skip to main content
Glama

Detectar riesgo de reenvío de tokens OAuth (token passthrough)

detect_token_passthrough_risk

Analiza el código fuente de un middleware o herramienta MCP que maneja el token de autorización de quien lo llama, en busca de señales del antipatrón "token passthrough" (confused deputy): (1) un middleware que deja pasar la petición (next()/call_next()) sin ninguna verificación de autorización reconocible antes — el patrón exacto detrás de CVE-2026-48039 (Meta Ads MCP, CVSS 9.1 CRÍTICO), donde un dispatch() reenviaba peticiones sin validar el header Authorization y filtraba el token de larga duración del operador; (2) el token de autorización de la petición ENTRANTE reenviado tal cual hacia otra llamada saliente, sin revalidarlo ni reemitir uno propio — la especificación oficial de MCP prohíbe explícitamente que un servidor acepte o reenvíe tokens que no fueron emitidos para él; (3) una verificación de JWT (jwt.verify/ jwt.decode) que no valida el claim "audience"/"aud", con lo que nada distingue un token emitido para este servidor de uno emitido para cualquier otro; y (4) un token colocado como parámetro de una URL en vez de en un header, expuesto en logs y cabeceras Referer. El mismo patrón de reenvío sin validar también aparece en CVE-2025-6514 (mcp-remote, CVSS 9.6) y CVE-2026-27826 (MCP Atlassian, CVSS 8.2). Es un análisis estático por patrones de texto (no ejecuta el código) — mismo enfoque que detect_ssrf_risk, detect_path_traversal_risk, detect_command_injection_risk y detect_sql_injection_risk. Requiere una llave de acceso válida (usos gratis o créditos) — ver POST /crear-llave.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "codigo": "<codigo>"
    },
    "name": "detect_token_passthrough_risk"
  }
}

Input Schema

NameRequiredDescriptionDefault
codigoYesEl código fuente del middleware/herramienta que maneja el token de autorización, en texto plano.
lenguajeNoSolo informativo (ej. "javascript", "python") — la detección ya cubre varios lenguajes a la vez, este campo no cambia el resultado.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full load and does reasonably well: it discloses that this is static pattern matching with no code execution, and that an access key with free uses or credits is required. It does not describe the result shape (findings, severity, line references) or any limits on input size, which an agent would want before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The four enumerated signals are load-bearing and worth the space, but the CVE identifiers with CVSS scores for CVE-2026-48039, CVE-2025-6514 and CVE-2026-27826 are decorative and pad a very long single sentence. The tool's own behavior (static, no execution) and the key requirement are buried at the end rather than front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description should say something about what comes back, and it says nothing about the returned findings format or severity reporting. It is otherwise complete enough to call correctly: input content, static-analysis nature, and authentication prerequisite are all covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so both parameters are already documented, and the description's statement that detection is language-agnostic mirrors what the schema already says about 'lenguaje' not changing the result. The description does narrow what belongs in 'codigo' (the middleware/tool handling the authorization token), but adds little else beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (analyze source code of an MCP middleware/tool handling the caller's authorization token) and enumerates the four concrete signals it looks for, including the exact next()/call_next()-without-auth-check pattern. It also distinguishes itself from adjacent detectors by declaring the shared static text-pattern approach with detect_ssrf_risk, detect_path_traversal_risk, detect_command_injection_risk and detect_sql_injection_risk.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Scope of applicability is clear: only code that handles the caller's authorization token, and explicitly a static analysis that does not execute the code. It also states the prerequisite (valid access key, POST /crear-llave). It does not say when to prefer detect_oauth_audience_confusion_risk or detect_missing_auth_risk even though signal (3) about missing aud validation overlaps that space, so no explicit exclusion is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources