Repository navigation
v0.21.0
Added
-
MCP024-MCP030: server-side MCP authorization rules. Before this
release, mcpscan's auth-adjacent rules looked at how a client connects to a
server, not at how a server validates the tokens it receives. A deliberately
naive MCP server that fails 8 authorization tests got a clean report from
0.20.0. Newmcpscan/rules/server_auth.py, AST-based (no regex):- MCP024 (high, MCP07):
jwt.decode()with signature verification
disabled (verify_signature: False, legacyverify=False, or"none"in
algorithms). - MCP025 (high, MCP07):
jwt.decode()with noaudience=or with
verify_aud: False. - MCP026 (medium, MCP07):
jwt.decode()with noissuer=or with
verify_iss: False. - MCP027 (low-medium, MCP07): hand-built 401s while nothing in the
project emits aWWW-Authenticate: Bearer resource_metadata=challenge. - MCP028 (medium, MCP07): hand-built bearer auth while no file routes
/.well-known/oauth-protected-resourceand no SDK helper serves it. - MCP029 (high, MCP01): token passthrough. The inbound
Authorization
header reaches an outboundAuthorizationheader, tracked by a small
intra-module taint analysis across returns, aliases and helper
parameters. - MCP030 (medium, MCP01):
access_tokenread from a query object.
Scope gate for precision: the rules only look at Python files that import
mcp/fastmcpor dispatchtools/call/tools/list. When the scan
contains such a server, they also cover modules that read the inbound
Authorizationheader. Test files are skipped. PyJWT and python-jose are
covered; authlib is not. On the naive/hardened experiment servers, 6 of 8
failures are now caught (was 0), with 0 findings on the hardened server.
The two remaining failures, per-tool scope checks and anonymous
tools/list, are runtime-only by nature. Also run against fastmcp, themcp
SDK, litellm, hermes-agent, paperclip and four smaller MCP projects: 0
new-rule findings after fixing two false-positive sources found in
litellm (outbound-request headers mistaken for inbound, and session-cookie
JWT decodes).
43 new tests (tests/test_server_auth.py), plus a vulnerable/clean
auth_server.pyfixture pair. - MCP024 (high, MCP07):
-
README: MCP023 was missing from the rules table; added together with
MCP024-MCP030 and the OWASP mapping.
Fixed
- Inline suppression now honors every
mcpscan: ignore[...]marker on a line,
not just the first.# mcpscan: ignore[MCP002] mcpscan: ignore[MCP023]used
to silence only MCP002. - Dogfood scan is clean again: MCP023 was flagging the attack sample strings in
tests/test_rule_mcp015.py, which had kept CI red since the rule landed.