Skip to content
Medium 4.7

SSRF (Server-Side Request Forgery) in github.com/stacklok/toolhive

CVE-2026-58196 First seen on SecPulse

Summary

SSRF in github.com/stacklok/toolhive (CVE-2026-58196). Risk of unauthorized operations or information disclosure. Exploitable via main. Mitigation: upgrade to 0.31.0 or later.

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-58196 has been found in github.com/stacklok/toolhive.
Attackers can target a specific entry point like main over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 4.7/10.
What to do: upgrade github.com/stacklok/toolhive to 0.31.0 or later.
If unsure, ask your IT team or search "github.com/stacklok/toolhive CVE-2026-58196" on the vendor's site.

CVE-2026-58196 (github.com/stacklok/toolhive) — CWE-918 / CVSS v3 4.7
Attack vector: remote (network-reachable) / unauthenticated
Attack surface: main / FetchResourceMetadata / ValidateRemoteURL / IsPrivateIP
Patched: 0.31.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

What is the problem

SSRF (CWE-918) exists in github.com/stacklok/toolhive. Attackers reach the vulnerable code path via main without authentication.

Affected scope

Check the vendor advisory for the affected versions of github.com/stacklok/toolhive. Attack surface: main / FetchResourceMetadata / ValidateRemoteURL / IsPrivateIP.

Severity

Severity: Medium (CVSS 4.7/10). Risk of unauthorized operations or information disclosure.

How to fix

Update to 0.31.0.

Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/stacklok/toolhive' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposureidentify
    grep -r 'github.com/stacklok/toolhive' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で github.com/stacklok/toolhive を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patchpatch
    Upgrade github.com/stacklok/toolhive to 0.31.0

    ステージング環境で 0.31.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verificationverify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

PackageAffected → Fixed
gogithub.com/stacklok/toolhive
< 0.31.0→ 0.31.0
Original description The description as published by the source.

ToolHive is a utility designed to simplify the deployment and management of Model Context Protocol (MCP) servers. Prior to 0.31.0, remote.Handler.Authenticate in pkg/auth/remote/handler.go invokes discovery.DetectAuthenticationFromServer in pkg/auth/discovery/discovery.go, whose host-side HTTP clients trust remote-server-controlled authentication discovery destinations, follow redirects without host or scheme restrictions, and do not consistently block private addresses. A malicious or compromised remote MCP server can place a resource_metadata URL in WWW-Authenticate for ParseWWWAuthenticate to extract, after which FetchResourceMetadata, OIDC issuer discovery, and well-known discovery can issue GET requests to link-local, RFC1918, or other internal services outside the server's container. The user connects to a server that the user intends to use, but the server controls the internal destination; this path does not depend on the separate NAT64 guard omission because the affected clients did not invoke IsPrivateIP, and it differs from the DCR resolver path that already refused redirects. The demonstrated primitive reaches internal-only HTTP services and reachability or error oracles, and can retrieve AWS metadata credentials where IMDSv1 accepts an unauthenticated GET, while IMDSv2 and GCP metadata prerequisites are not satisfied by the demonstrated request. This vulnerability is fixed in 0.31.0.

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details