# CVE-2026-58196: ToolHive: SSRF in remote MCP server authentication discovery (host-side, bypasses container isolation)

- Severity: Medium 4.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.38%, higher than 33% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-07-15T23:41:21.000Z
- Modified: 2026-09-30T17:51:56.193Z
- Also known as: GHSA-pr64-jmmf-jp54, GO-2026-6002
- Weaknesses: CWE-918
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- stacklok toolhive: < 0.31.0
- github.com/stacklok/toolhive (Go): before 0.31.0

## Every score

- GitHub_M: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N`
- GitHub: CVSS:3.1 4.7 Low `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N`
- GitHub: CVSS:4.0 Low `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:P`

## References

- <https://github.com/stacklok/toolhive/security/advisories/GHSA-pr64-jmmf-jp54> (exploit, advisory, web)
- <https://github.com/stacklok/toolhive/commit/4ea6afb9048ddec1d56875fa9e0da36d65c15966>
- <https://github.com/stacklok/toolhive/releases/tag/v0.31.0>
- <https://github.com/stacklok/toolhive> (package)

## Sources

- CVE List: [CVE-2026-58196](https://www.cve.org/CVERecord?id=CVE-2026-58196), CVE Terms of Use, modified 2026-09-15
- GitHub Advisory Database: [GHSA-pr64-jmmf-jp54](https://github.com/advisories/GHSA-pr64-jmmf-jp54), CC-BY-4.0, modified 2026-07-21
- Go Vulnerability Database: [GO-2026-6002](https://pkg.go.dev/vuln/GO-2026-6002), CC-BY-4.0, modified 2026-07-21
- NVD: [CVE-2026-58196](https://nvd.nist.gov/vuln/detail/CVE-2026-58196), Public domain, modified 2026-09-30

---

Page: https://cve.day/CVE-2026-58196 · Whole record: https://cve.day/CVE-2026-58196.json · Rebuilt by cve.day 2026-11-25T22:59:38.560Z
