/

CVE-2026-11720

Severity:

CRITICAL RISK

(9.1)

Path Traversal (CWE-22) in mcp-toolbox HTTP URL Builder

CVE-2026-11720

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized Access to Protected HTTP Endpoints

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal issue in the mcp-toolbox HTTP URL builder lets user-controlled path parameters escape an operator-configured URL scope when building downstream API requests.

By abusing dot-segment normalization (../), an attacker can coerce the toolbox into calling unintended endpoints on the same host while forwarding its configured credentials.

Affected context

This vulnerability appears when mcp-toolbox is configured as an HTTP client that builds downstream API URLs using path parameters supplied by users or upstream tools.

The issue is most relevant in deployments where:

  • Tool paths are intended to restrict requests to specific URL prefixes on a target host
  • The toolbox forwards authenticated credentials (e.g., API keys, tokens, cookies)
  • PathParams are not constrained to safe, non-hierarchical segments

In such environments, the URL builder's reliance on relative URL resolution allows traversal outside the intended path scope.

Exploit preconditions

  • Attack surface: HTTP tool invocation interface (e.g., MCP tools, API clients, or integrations that accept path parameters).
  • Required access: Ability to supply or influence pathParams used in building tool URLs (often via a request field, tool argument, or upstream orchestration).
  • Trigger point: Construction of the downstream request URL using the toolbox's URL builder, which resolves relative paths with dot-segment normalization.
  • Why exploitation is possible: The path validation only guards scheme, host, and user info but delegates final URL resolution to a mechanism (ResolveReference) that collapses ../ segments, enabling traversal out of the configured base path.

Why this happens

The underlying bug is a classic path traversal (CWE-22) in a URL construction context.

The URL builder treats user-controlled pathParams as relative path segments and relies on the URL resolution algorithm to produce the final request target.

While the implementation checks that the scheme, host, and user info remain unchanged, it does not enforce that the resolved path stays within the operator-defined base path, nor does it strip or reject hierarchical traversal sequences.

As a result, dot-segment normalization (../ and ./) allows user input to escape the intended path scope and reach arbitrary endpoints on the same host.

Potential impact

  • Clients may reach sensitive endpoints such as /admin or /secrets instead of the intended scoped API paths.
  • Attackers could leverage the toolbox's authenticated session or API key to access restricted resources.
  • Unauthorized reading or modification of data protected by path-based access controls could occur.
  • Bypass of operator-enforced request scoping and routing policies within the target service.

General mitigation guidance

Effective mitigation focuses on constraining how user input influences URL paths and enforcing strict path boundaries.

Useful defensive patterns include:

  • Normalizing and validating the resolved path against an allowed prefix or whitelist of endpoints before sending any request.
  • Treating path parameters as opaque identifiers rather than arbitrary path segments, rejecting ../, ./, and leading slashes.
  • Building URLs through safe, non-relative composition (e.g., join fixed base paths with sanitized segments using a dedicated path-join function).
  • Applying least-privilege credential scopes so that forwarded tokens or keys cannot access highly privileged endpoints even if path traversal occurs.
  • Designing tools so that sensitive administrative or secret-bearing endpoints are not exposed via generic, parameterized tool paths.

How teams detect issues like this

Detection typically combines code-level inspection with behavioral monitoring:

  • Static analysis or linting rules that flag use of relative URL resolution (ResolveReference-style APIs) with user-supplied path segments.
  • Code review checklists that call out any path concatenation or URL-building logic using unsanitized parameters, especially where credentials are reused.
  • Unit and integration tests that attempt requests with ../ segments in pathParams and assert that the resulting URLs remain within the expected path scope.
  • Runtime logging of final resolved request URLs and simple anomaly detection for requests targeting unexpected high-privilege paths.
  • Policy enforcement in CI/CD pipelines requiring explicit path validation when constructing outgoing HTTP requests from user-controlled data.

Sources

SourceLink
github.comgithub.com/googleapis/mcp-toolbox/pull/3218

Frequently asked

questions

Exploitability depends on who can supply pathParams to the toolbox. In any scenario where an attacker can influence those parameters and the toolbox holds valid credentials, the vulnerability can be used to access more privileged endpoints on the same host.

The attacker needs the ability to invoke the HTTP tool or otherwise control the path parameters used when building URLs. They do not need direct access to the target service's credentials, as the toolbox forwards its own.

Enforce that the resolved path always stays within a defined base path scope. This typically means sanitizing pathParams, rejecting traversal sequences, and validating the final normalized path against an allowed prefix or explicit allowlist before sending any request.

Treat any user-controlled path component as untrusted, avoid relative URL resolution with such inputs, and embed path boundary checks into shared URL-building utilities. Complement this with least-privilege credential scopes and automated tests that deliberately attempt path traversal to ensure defenses remain effective.

Find out what's already
exploitable in your codebase.