Skip to content

Security: require 'audience' for jwt auth (RFC 8707 confused-deputy defense)#5

Merged
thorwhalen merged 1 commit into
mainfrom
claude/require-audience
Jun 17, 2026
Merged

Security: require 'audience' for jwt auth (RFC 8707 confused-deputy defense)#5
thorwhalen merged 1 commit into
mainfrom
claude/require-audience

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

What

fastmcp's JWTVerifier accepts audience=None and then skips audience validation. mk_auth_provider passed the caller's audience straight through, so omitting it silently disabled the RFC 8707 audience binding — a token minted for another service could be replayed against this server (confused-deputy).

For a helper whose entire purpose is to build a secure OAuth 2.1 resource server, that fail-open default is wrong. Now audience is required for type='jwt'; a missing one raises a clear, educational error.

Also

Syncs pyproject.toml version 0.1.4 → 0.1.5 — PyPI already has 0.1.5 (published when the http feature merged), but the wads auto-bump never pushed the version bump back to main (the known push-back desync). Without this, the next merge would try to re-publish 0.1.5 and fail; with it, the bump lands on 0.1.6.

Why now

Found by an adversarial security review of coact's remote-connector work (which builds on this layer). coact always supplies an audience, so it is unaffected — this hardens the helper against any caller.

Tests

+1 regression test (test_missing_audience_raises); full suite 20 passed; ruff clean.

… defense)

fastmcp's JWTVerifier accepts audience=None and then SKIPS audience validation.
mk_auth_provider passed the caller's audience straight through, so omitting it
silently disabled the RFC 8707 audience binding — a token minted for another
service could be replayed against this server (confused-deputy). For a helper
whose whole job is to build a SECURE resource server, that fail-open default is
wrong: now 'audience' is required for type='jwt' and a missing one raises a clear
error. Also sync pyproject version to 0.1.5 (PyPI already has 0.1.5 from the http
merge; the wads auto-bump never pushed the bump back) so the next publish is 0.1.6.

Found by an adversarial security review of the remote-connector work. +1 test.
@thorwhalen thorwhalen merged commit bbabb01 into main Jun 17, 2026
12 checks passed
@thorwhalen thorwhalen deleted the claude/require-audience branch June 17, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant