Skip to main content

Microsoft CVE-2026-27124

HIGH
Unintended Proxy or Intermediary ('Confused Deputy') (CWE-441)
2026-03-31 https://github.com/PrefectHQ/fastmcp GHSA-rww4-4w9c-7733
8.2
CVSS 4.0 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
8.2 HIGH
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Red Hat
6.5 MEDIUM
qualitative

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

4
Re-analysis Queued
Apr 22, 2026 - 14:52 vuln.today
cvss_changed
Patch released
Apr 01, 2026 - 02:30 nvd
Patch available
Analysis Generated
Mar 31, 2026 - 23:31 vuln.today
CVE Published
Mar 31, 2026 - 22:32 nvd
HIGH 8.2

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 23 pypi packages depend on fastmcp (22 direct, 1 indirect)

Ecosystem-wide dependent count for version 3.2.0.

DescriptionGitHub Advisory

Summary

While testing the *GitHubProvider* OAuth integration, which allows authentication to a FastMCP MCP server via a FastMCP OAuthProxy using GitHub OAuth, it was discovered that the FastMCP OAuthProxy does not properly validate the user's consent upon receiving the authorization code from GitHub. In combination with GitHub’s behavior of skipping the consent page for previously authorized clients, this introduces a Confused Deputy vulnerability.

Technical Details

An adversary can initiate an authentication flow by connecting their malicious MCP client to a benign MCP server using the *GitHubProvider* OAuth integration. During this flow, the attacker consents to connect their client to the MCP server and, at that point, can capture the GitHub authorization URL they are redirected to after granting consent. The attacker can then lure a victim, who is already logged into GitHub and has previously connected an MCP client to the benign MCP server, to open this captured URL. As a result, the victim’s browser is immediately redirected to the OAuthProxy’s callback endpoint, which does not correctly enforce that this browser has just given consent. The OAuthProxy then redirects the victim’s browser to the malicious MCP client’s callback URL with a valid authorization code. The attacker can exchange this code for an access token to the benign MCP server associated with the victim’s GitHub account, potentially gaining unauthorized access to resources tied to that account.

Although this issue was verified in practice only for the *GitHubProvider*, a review of the source code, specifically the OAuthProxy._handle_idp_callback function, shows that the IdP callback handler does not verify whether the browser sending the state and code has previously consented to connecting the client to the server. As long as a valid state and code pair is provided, the OAuthProxy requests an access token from the IdP and then redirects the user-agent to the client’s callback URL with a new code and the corresponding state, allowing the client to retrieve the access token from the proxy. This pattern causes all OAuth integrations whose IdP allows skipping the consent page to be vulnerable to this attack.

Skipping the consent page is not, by itself, a vulnerability on the IdP side. Many providers legitimately skip consent for first-party or previously authorized clients with the same scopes. In this case, the core problem lies in the OAuthProxy callback handler not correctly verifying that the browser issuing the callback request is the same one that has just given the required consent.

Steps to reproduce

  1. Set up an MCP server using the *GitHubProvider* integration.
  2. Connect a benign MCP client to this MCP server.
  3. Configure your default browser to route all traffic through an interception proxy such as Burp Suite.
  4. In a private browsing window or a second browser, log into the GitHub account used in step 2.
  5. As the attacker, connect a new (malicious) MCP client to the MCP server from step 1.
  6. When the browser opens for the attacker’s client, enable interception in your proxy.
  7. In the browser, confirm the consent prompt.
  8. In the proxy, forward all requests up to the authorization request to the GitHub authorization server.
  9. Copy the authorization URL and drop the intercepted request.
  10. Simulate luring the victim onto the URL by opening this URL in the browser window opened in step 4.
  11. Observe that the malicious client receives a valid authorization code and gains access to the benign MCP server using the victim’s GitHub account.

In a more realistic scenario, the malicious client could be a public MCP client or a simple web server that logs the received authorization code or token, which the attacker then uses to obtain the access token and connect to the MCP server as the victim.

Recommendation

To mitigate this issue, the OAuthProxy should verify that the browser sending the authorization code has actually given consent for the corresponding client. This can be achieved by setting and validating a consent cookie or similar browser-bound state, as described in the mitigations section for this vulnerability in the MCP specification.

AnalysisAI

FastMCP OAuthProxy allows authentication bypass through a Confused Deputy attack, enabling attackers to hijack victim OAuth sessions and gain unauthorized access to MCP servers. When victims who previously authorized a legitimate MCP client are tricked into opening a malicious authorization URL, the OAuthProxy fails to validate browser-bound consent, redirecting valid authorization codes to attacker-controlled clients. This affects the GitHubProvider integration and potentially all OAuth providers that skip consent prompts for previously authorized applications. No public exploit identified at time of analysis, though detailed reproduction steps are publicly documented in the GitHub security advisory.

Technical ContextAI

FastMCP is a Python package (pkg:pip/fastmcp) that implements OAuth-based authentication for Model Context Protocol (MCP) servers through an OAuthProxy component. The vulnerability stems from CWE-441 (Unintended Proxy or Intermediary / Confused Deputy), where the OAuthProxy acts as an intermediary between OAuth identity providers and MCP clients but fails to maintain proper session binding. The root cause lies in the OAuthProxy._handle_idp_callback function, which processes OAuth callbacks by accepting any valid state and code parameter pair without verifying that the browser presenting these credentials is the same user-agent that initiated the authentication flow and granted consent. OAuth providers like GitHub legitimately skip consent screens for previously authorized applications with identical scopes, which is standard behavior but becomes exploitable when the callback handler lacks browser-bound state validation (such as consent cookies or PKCE-equivalent binding mechanisms). The attack exploits the separation between the consent-granting browser session and the code-receiving browser session, allowing an attacker to substitute their malicious client's callback URL while using a victim's valid authorization grant.

RemediationAI

Implement browser-bound consent validation in the OAuthProxy callback handler as recommended in the MCP specification security best practices. The primary mitigation involves setting a secure, HttpOnly, SameSite consent cookie during the initial authentication flow and validating this cookie's presence when processing the IdP callback in the OAuthProxy._handle_idp_callback function. This ensures the browser receiving the authorization code is the same browser that granted consent, preventing Confused Deputy attacks. Alternative or supplementary controls include implementing PKCE (Proof Key for Code Exchange) flow binding, session-specific state tokens tied to browser sessions, or short-lived nonce validation. Organizations should monitor the GitHub security advisories at https://github.com/PrefectHQ/fastmcp/security/advisories/GHSA-rww4-4w9c-7733 and https://github.com/jlowin/fastmcp/security/advisories/GHSA-rww4-4w9c-7733 for vendor-released patches with specific fix versions. Until patches are available, consider temporary mitigations such as disabling OAuth authentication if alternative authentication methods exist, implementing network-level restrictions on MCP server access, or adding custom middleware to validate OAuth callbacks. Organizations should audit existing OAuth sessions for anomalous authorization patterns that might indicate exploitation.

Vendor StatusVendor

Share

CVE-2026-27124 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy