patchbay audit
criticalAUDIENCE-001

Server accepts cross-audience bearer tokens

tools/list succeeded with a bearer token that was minted for a different resource on the same authorization server.

What it means

One authorization server often issues tokens for several resources: your MCP server, an internal API, a sibling product. Each token carries an "aud" (audience) claim naming the resource it was issued for. If your MCP server does not check that claim, a token issued for any sibling resource also works against the MCP server, so whoever holds or can obtain a token for the weakest sibling can call your tools. Discovery metadata cannot reveal this. No standard metadata field states that a server validates the audience, which is why this check sends a real request. The check only runs when you supply a probe token with --probe-audience=<token> (or the PATCHBAY_PROBE_AUDIENCE_TOKEN environment variable). Use a token you are entitled to hold, minted for a different resource on the same authorization server. If the probe gets no clear answer, the finding is reported as info ("probe inconclusive") instead of critical.

How to fix

Validate the "aud" claim on every incoming bearer token. The expected audience is this MCP server's own resource identifier, the value you publish as "resource" in /.well-known/oauth-protected-resource. Reject any token whose audience does not match with HTTP 401.

Spec

RFC 8707 §2

Background

Audience validation for MCP servers

Run the check against your own server:

npx -y @patchbay-nebius/agent audit <url-or-directory>

No install: scan an MCP server in the browser and get a shareable report.

Disagree with this finding on your server? Open an issue with the --json output. False-positive reports are the most useful feedback.