# CVE-2026-58196: Stacklok ToolHive SSRF in remote MCP server authentication discovery

Source: https://junglewise.ai/threats/cve-2026-58196-stacklok-toolhive-ssrf-in-remote-mcp-server-authentication  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-15. Updated: 2026-07-16  
License: CC BY 4.0 with a link back

CVE-2026-58196 · Severity: medium · CVSS 4.7 · Published 2026-09-15

ToolHive, a tool for running isolated AI server components, contains a security flaw that allows a malicious server to bypass its protective sandbox. When a user connects to a compromised or malicious remote server, that server can trick the ToolHive host application into making unauthorized requests to internal company systems or cloud metadata services. This could lead to the exposure of sensitive internal data or cloud credentials, defeating the primary security isolation ToolHive is intended to provide.

Technologies: [github.com/stacklok/toolhive (Go)](https://junglewise.ai/threats/technologies/github-com-stacklok-toolhive), [Stacklok ToolHive](https://junglewise.ai/threats/technologies/toolhive). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Stacklok](https://junglewise.ai/threats/vendors/stacklok).

## Quick answers

**Is CVE-2026-58196 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-58196 being exploited in the wild.

**How severe is CVE-2026-58196?** Medium severity, with a CVSS score of 4.7, published 15 September 2026.

**Which products and versions are affected?** github.com/stacklok/toolhive (Go) < 0.31.0, SEMVER:introduced=0,fixed=0.31.0; Stacklok ToolHive < 0.31.0.

**Is there a fix for CVE-2026-58196?** Yes. github.com/stacklok/toolhive (Go): upgrade to 0.31.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-58196 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-58196?** Check whether you run github.com/stacklok/toolhive (Go) or Stacklok ToolHive at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/stacklok/toolhive (Go): upgrade to 0.31.0 or later

  ```sh
  go get github.com/stacklok/toolhive@v0.31.0
  ```


## Technical details

A Server-Side Request Forgery (SSRF) vulnerability exists in ToolHive's authentication discovery clients within `pkg/auth/discovery` and `pkg/auth/remote`. The discovery process issues outbound HTTP requests to URLs provided by remote MCP servers (via `WWW-Authenticate` headers or OIDC discovery) without validating against private IP ranges or restricting redirects. Because this discovery logic executes on the host side rather than within the isolated per-server container, a malicious server can use HTTP 302 redirects to force the ToolHive host to fetch internal resources, such as AWS IMDSv1 credentials at 169.254.169.254. The vulnerability stems from maintainers explicitly suppressing security linters (gosec G704) based on a false assumption of trust for the remote endpoint. The issue is addressed in version 0.31.0 by implementing redirect validation and private IP guards.

## Affected products

- stacklok ToolHive < 0.31.0

## Identifiers

- CVE-2026-58196
- GHSA-pr64-jmmf-jp54
- GO-2026-6002

## Timeline

- 2026-06-12: disclosed: Vulnerability identified at commit 05f11b53
- 2026-06-26: advisory: Initial GitHub Advisory published
- 2026-07-15: patched: Final advisory update and patch confirmation for v0.31.0

## References

- [https://api.github.com/users/bIackr0se](https://api.github.com/users/bIackr0se)
- [https://github.com/bIackr0se](https://github.com/bIackr0se)
- [https://api.github.com/users/bIackr0se/gists%7B/gist_id%7D](https://api.github.com/users/bIackr0se/gists%7B/gist_id%7D)
- [https://api.github.com/users/bIackr0se/repos](https://api.github.com/users/bIackr0se/repos)
- [https://avatars.githubusercontent.com/u/197056670?v=4](https://avatars.githubusercontent.com/u/197056670?v=4)
- [https://api.github.com/users/bIackr0se/events%7B/privacy%7D](https://api.github.com/users/bIackr0se/events%7B/privacy%7D)

## Related threats

- [ToolHive containerized MCP servers host service access via host.docker.internal](https://junglewise.ai/threats/cve-2026-58197-toolhive-containerized-mcp-servers-host-service-access-via-host)
- [Stacklok ToolHive SSRF bypass via IPv6 NAT64 ranges](https://junglewise.ai/threats/cve-2026-54450-stacklok-toolhive-ssrf-bypass-via-ipv6-nat64-ranges)
