Executive brief
HashiCorp terraform-mcp-server, a tool used to integrate Terraform with Model Context Protocol (MCP) clients, is vulnerable to a flaw that allows user credentials to be reused across different accounts. In specific configurations, the server fails to properly separate user sessions, meaning one user's authentication token could be used to perform actions on behalf of other users. This could lead to unauthorized access to sensitive infrastructure managed by Terraform, including the ability to view or modify cloud resources.
Technical details
A vulnerability exists in terraform-mcp-server when configured in stateless HTTP transport mode. The server's per-session Terraform client cache relies on session identifiers to isolate user credentials; however, in stateless mode, the underlying MCP library does not assign unique session identifiers. Consequently, the server fails to correctly isolate credentials across requests, causing the Terraform token supplied by one tenant to be reused for subsequent requests from other tenants. An unauthenticated remote attacker can exploit this to execute tool calls using the permissions of a previous user's token. This issue is fixed in version 1.1.0.
Affected products
- HashiCorp terraform-mcp-server 0.2.1 up to and including 1.0.0
Timeline
- 2026-07-28: disclosed
- 2026-07-28: patched