Dev.to Security πŸ” Cybersecurity πŸ‘ 2 πŸ“– 8 min read

Hidden Is Not Denied: How Three MCP Servers Filtered the Tool List but Not the Tool Call

TL;DR: Three unrelated MCP projects shipped the same authorization bug in 2026: the tool allowlist was applied when the server answered tools/list, but not when it handled tools/call. mcp-atlassian (CVE-2026-77243, CVSS

TL;DR: Three unrelated MCP projects shipped the same authorization bug in 2026: the tool allowlist was applied when the server answered tools/list, but not when it handled tools/call. mcp-atlassian (CVE-2026-77243, CVSS 8.8, fixed in 0.22.0), mcp-server-kubernetes (CVE-2026-46519, CVSS 8.8, fixed in 3.6.0) and fastmcp (GHSA-c3q8-4mcq-p7vg, Moderate, fixed in 3.4.8 and 4.0.11) all hid tools from the menu and still ran them when a client asked by name. A hidden tool is not a denied tool. Below: what each advisory says, a ten-line simulation you can run, a regression test to copy, and a gate design that enforces policy at the one place that matters, the call.

Tools a client can actually run, with and without call-time enforcement

What is the list-time versus call-time authorization bug?

An MCP server exposes two relevant requests. tools/list tells the client what exists. tools/call runs one. Many servers let an operator restrict the toolset with environment variables or API calls such as "enabled tools", "read-only tools" or disable(...). The bug appears when that restriction is implemented as a filter on the list response and nowhere else.

The call handler then does what it always did: look the name up in the full registry and dispatch. A client that never needed the menu, because it already knows or can guess the name, gets the tool. The menu is documentation. It is not a control.

This matters for agents more than for human-driven clients, for a specific reason. A person who sees five tools in a picker will use five tools. A model that has been steered by injected text in a web page, an issue comment or a tool result will happily emit a tools/call for a name it was told about, or one it remembers from training. Filtering what the model is shown shrinks the honest attack surface and leaves the dishonest one untouched.

What do the three advisories say?

All facts below come from the public advisories. I did not run exploits against any of these projects and I am not publishing any.

Project Identifier Severity Affected Fixed
mcp-atlassian (pip) CVE-2026-77243 / GHSA-3r68-hf9h-887v High, CVSS 8.8 below 0.22.0 0.22.0
mcp-server-kubernetes (npm) CVE-2026-46519 / GHSA-cr22-wjx7-2w6m High, CVSS 8.8 below 3.6.0 3.6.0
fastmcp (pip) GHSA-c3q8-4mcq-p7vg (no CVE) Moderate 3.2.0 to below 3.4.8, 4.0.0 to below 4.0.11 3.4.8, 4.0.11

mcp-atlassian. The ENABLED_TOOLS and TOOLSETS filters were enforced at tools/list time only. The server overrode the list handler to apply them but did not override the call handler, so the default implementation resolved names from the full, unfiltered registry of 73 tools. A client that knew a name could call an excluded tool, including write operations such as creating Jira issues. The advisory is explicit that READ_ONLY_MODE was not affected, because it is enforced at both list time and call time through a write-access decorator. The weakness class is CWE-862, missing authorization. The advisory says the risk is greatest for multi-user HTTP deployments, since a single-user stdio setup has no second principal to defend against.

mcp-server-kubernetes. Three restriction variables, ALLOW_ONLY_READONLY_TOOLS, ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS and ALLOWED_TOOLS, were enforced in the discovery step but not at execution. The advisory's own title names the pattern: presentation-layer filtering without execution-layer enforcement. A client that knew a tool name could call something like kubectl_delete even when it was hidden from the list, in all three modes. The fix applies the same filter at the top of the call handler and returns an error for anything outside the active allowed set.

fastmcp. This one is a variation, and the most instructive. Calling a tool by its normal name went through a lookup that applied visibility transforms and an enabled check. If that lookup found nothing, the call path fell back to parsing a hashed backend name and resolving it through a second function that walked the raw provider components and checked only the tool's explicit auth= setting. A tool hidden with server.disable(...) vanished from the list and could not be called by name, yet still ran when called by its deterministic hashed name. The advisory notes that explicit auth= checks still applied and that impact depends on the disabled operation, so it is not a universal bypass. The patches route hashed names through the same lookup, so disabled state, transforms and version filters apply to every path.

Two of the three advisories credit the same researcher, Francisco Rosales of Manifold Security, which suggests this class is worth auditing for deliberately rather than waiting for the next report.

Why does the same mistake keep appearing?

Three reasons show up in the descriptions.

  1. The policy lives in the view. Filtering a list is the easiest place to express "the model only sees these tools", and it is also where the feature is demonstrated and tested. Nobody notices the missing check because the happy-path test asks the list, not the call.
  2. There is more than one way to reach a tool. Name lookup, hashed name, versioned name, mounted sub-app, alias. Each path is a separate chance to skip the check. The fastmcp case is exactly a second path that forgot the first path's rules.
  3. Defaults dispatch from the full registry. A framework that resolves calls from everything registered is doing its job. The restriction has to be layered on top of dispatch, not beside the menu.

How big is the gap? A runnable illustration

The numbers here are from a toy server, not from any of the projects. They are illustrative. The point is the shape: the list shows the policy, the call path shows reality.

TOOLS = {f"tool_{i:02d}": ("write" if i % 2 else "read") for i in range(20)}
ALLOWED = {t for t, kind in TOOLS.items() if kind == "read"}

def list_tools():            return [t for t in TOOLS if t in ALLOWED]
def call_list_only(name):    return name in TOOLS                    # bug
def call_enforced(name):     return name in TOOLS and name in ALLOWED

probe = list(TOOLS)
print(len(list_tools()),
      sum(call_list_only(t) for t in probe),
      sum(call_enforced(t) for t in probe))

Running it on Python 3.12 prints 10 20 10: ten tools listed, twenty callable when only the list is filtered, ten callable when the call path enforces the same policy. Half of the "hidden" surface was never hidden.

CVSS 3.1 scores of the two CVE-tracked advisories

How do I test for this in my own MCP server?

Test the property directly: every tool that is absent from tools/list must be refused by tools/call, through every path you support. This is a regression test, not an exploit.

import pytest

async def all_names(server):
    # every registered name, including aliases and hashed forms if you expose them
    return await server.registry_names()

@pytest.mark.asyncio
async def test_hidden_tools_are_refused(server_with_policy):
    listed = set(await server_with_policy.list_tools())
    for name in await all_names(server_with_policy):
        if name in listed:
            continue
        result = await server_with_policy.call_tool(name, {})
        assert result.is_error, f"{name} is hidden but still callable"

Add one case per alternate path: hashed names, versioned names, mounted sub-servers, and aliases. If your framework has a "read-only" mode, assert it from both ends, as the mcp-atlassian maintainers did for that flag. The fastmcp advisory lists exactly this kind of test as a recommendation: regression tests for disabled and allowlist-excluded app tools, including mounted apps.

How should an agent gate enforce tool policy?

The design that survives all three advisories is small.

  1. One decision function. allowed(principal, tool, args) -> bool, called from a single choke point on the execution path. The list handler calls the same function, so the menu is derived from the policy and never the other way round.
  2. Resolve first, then decide. Normalize the name to the canonical tool object before the check. Decide on the object, not on the string the client sent. A hashed name, an alias and a plain name should land on one canonical identity before the gate sees them. This is the same lesson as object-bound confinement for file paths: check what will be executed, not what was typed.
  3. Default deny. If the policy engine cannot resolve a tool, refuse. The fastmcp fallback path gave an unresolved name a second chance to resolve through code that did not know the rules.
  4. Gate the principal, not the process. In multi-user HTTP deployments the filter must know who is asking. A server-wide environment variable is a deployment default, not a per-caller authorization.
  5. Log denials with the reason. A denied call for a tool the model was never shown is a strong signal that something upstream is steering it. Treat it as a security event.
  6. Pin and upgrade. If you run these servers, check the versions in the table. The advisories name upgrading as the remedy; the mcp-atlassian advisory lists no workaround.
def dispatch(principal, raw_name, args, registry, policy):
    tool = registry.resolve_canonical(raw_name)      # aliases, hashes, versions
    if tool is None or not policy.allows(principal, tool, args):
        audit.denied(principal, raw_name, tool)
        raise PermissionError("tool not permitted")
    return tool.run(args)

def list_tools(principal, registry, policy):
    return [t for t in registry.all() if policy.allows(principal, t, None)]

What should I check this week?

  • Which MCP servers in your stack restrict tools with environment variables, and do they enforce at call time? Read the call handler, not the README.
  • Are any of them below the fixed versions above?
  • Do you have a test that calls a hidden tool by name and expects an error?
  • Does every alternate name path (alias, hash, version, mount) go through the same lookup?
  • Do your logs distinguish "tool not listed" from "tool call denied"?

FAQ

Is hiding a tool from tools/list a security control?
No. It reduces what a cooperating client sees. Authorization has to be enforced when the tool executes.

Which versions fix these issues?
mcp-atlassian 0.22.0, mcp-server-kubernetes 3.6.0, fastmcp 3.4.8 or 4.0.11, according to the advisories.

Does read-only mode protect me?
It depends on the implementation. In mcp-atlassian the read-only mode was enforced at both list and call time and was not affected. Verify any mode you rely on with a call-time test.

Do stdio deployments need to worry?
The mcp-atlassian advisory says single-user stdio deployments have no second principal to defend against. An injected model is still a second influence on the call, so a call-time check is cheap insurance.

Why do agents make this worse?
A model can be steered by untrusted text to emit a call for a tool it was never shown. A filtered menu does nothing against that.

What is the single rule to remember?
Derive the menu from the policy, and enforce the policy at the call.

Sources

Further reading

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.