Skip to main content
Glama

Escudo de Confusión de Audiencia OAuth

detect_oauth_audience_confusion_risk

Analiza el código fuente del VERIFICADOR PROPIO de tokens OAuth/JWT de un servidor con más profundidad que detect_token_passthrough_risk (que solo mira si "audience"/"aud" aparece cerca, una señal superficial): detecta cuando esa validación SÍ existe pero está rota de forma sutil — (1) condicionada a una bandera de configuración (config.checkAudience, options.strictMode) que puede estar desactivada; (2) su rama de "no coincide" solo registra una advertencia en vez de rechazar la petición (throw/return/res.status); o (3) un bloque catch() silencia el error que la librería ya lanzó al detectar la discrepancia — y también detecta (4) la ausencia total de cualquier chequeo de audiencia en el verificador. En los tres primeros casos el código "tiene" una validación que un lector apurado asumiría que funciona, pero que en la práctica deja pasar un token emitido para otro servidor (confused deputy vía audiencia). El mismo patrón detrás de CVE-2026-14541. Es un análisis estático por patrones de texto (no ejecuta el código) — mismo enfoque que detect_token_passthrough_risk y detect_missing_auth_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_oauth_audience_confusion_risk"
  }
}

Input Schema

NameRequiredDescriptionDefault
codigoYesEl código fuente del verificador de tokens OAuth/JWT del servidor, 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

A4.1/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 burden and does well: it discloses the method (static text-pattern analysis, no code execution), the auth/credit requirement, and the same-approach relationship to two siblings. It omits return format and any false-positive/noise characteristics, which keeps it from a 5.

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

Conciseness4/5

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

Purpose and the comparison to the sibling are front-loaded, and the parenthetical examples (config.checkAudience, options.strictMode, throw/return/res.status) earn their space by making the failure modes concrete. It is dense and long for a single block, but nearly every clause carries detection-relevant information.

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

Completeness4/5

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

For a tool with no annotations and no output schema, the definition covers method, scope, the four detection cases, the security rationale (confused deputy, CVE-2026-14541), and the API key requirement. What is missing is what the analysis returns and how findings are reported, which matters given no output schema exists.

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 in the input schema. The description adds no parameter-level meaning, not even confirming that the language field is informational only — baseline 3 applies when the schema does the heavy lifting.

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 the server's own OAuth/JWT token verifier source code) and explicitly contrasts it with the sibling detect_token_passthrough_risk, which it characterizes as a shallower 'audience appears nearby' check. An agent can distinguish the two without opening either schema.

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?

Gives clear selection context by naming the shallower alternative and explaining its limitation, plus enumerates four concrete conditions the tool detects, which tells the agent what input scenario it is for. It stops short of an explicit 'use this instead when...' / 'do not use when...' statement or prerequisites beyond the API key note.

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.