CVE-2026-27124: FastMCP Missing Consent Verification Vulnerability

HIGH
Advisory Identifier: GHSA-rww4-4w9c-7733
CWE-441
Published
Advisory Summary

CVE-2026-27124 is a HIGH missing consent verification vulnerability (CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')) affecting FastMCP libraries in the PyPI ecosystem. The issue involves missing consent verification in oauth proxy callback facilitates confused deputy vulnerabilities. Remediation is available by upgrading affected packages to version 3.2.0.

CVE-2026-27124 at a Glance

CVE Identifier CVE-2026-27124
GHSA Identifier GHSA-rww4-4w9c-7733
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')
Affected Product FastMCP
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-27124

To remediate this vulnerability, upgrade all affected FastMCP dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

fastmcp fixed: 3.2.0
pip install fastmcp>=3.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show fastmcp

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-27124, inspect your installed packages using pip:

pip show fastmcp

Analyze the terminal output to locate any version of FastMCP in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.0), your application is affected.

Note: The pip show fastmcp command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-441: Unintended Proxy or Intermediary ('Confused Deputy'), where the product receives a request, message, or directive from an upstream component, but the product does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the product's control sphere. this causes the product to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor. In FastMCP, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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](https://github.com/jlowin/fastmcp/blob/ee5f465a82350e1c5a56c4a2b47cfdc4cd736e76/src/fastmcp/server/auth/oauth_proxy.py#L1762), 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](https://mcp.mintlify.app/specification/2025-11-25/basic/security_best_practices#mitigation) for this vulnerability in the MCP specification.

CVE-2026-27124 Affected FastMCP Versions

1 component(s)
Fixed Versions:
3.2.0
Product / Package Ecosystem Affected Versions Fixed Version
fastmcp
PyPI
< 3.2.0
3.2.0

References

Frequently Asked Questions

What is CVE-2026-27124?
CVE-2026-27124 is a security vulnerability in FastMCP involving Missing Consent Verification in OAuth Proxy Callback Facilitates Confused Deputy Vulnerabilities under CWE-441: Unintended Proxy or Intermediary ('Confused Deputy').
Which FastMCP versions are affected?
Affected versions include releases prior to 3.2.0 across affected packages: fastmcp.
What version fixes CVE-2026-27124?
Upgrading to 3.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fastmcp affected?
Yes, fastmcp is affected in releases prior to 3.2.0. Upgrade your dependency to 3.2.0 or later.
What CWE is associated with CVE-2026-27124?
CVE-2026-27124 is classified under CWE-441: Unintended Proxy or Intermediary ('Confused Deputy') (The product receives a request, message, or directive from an upstream component, but the product does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the product's control sphere. This causes the product to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor.).
How can I check PyPI dependencies for CVE-2026-27124?
Run the dependency tree command: 'pip show fastmcp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rww4-4w9c-7733",
  "modified" : "2026-04-06T17:37:56Z",
  "published" : "2026-03-31T22:32:28Z",
  "aliases" : [ "CVE-2026-27124" ],
  "summary" : "FastMCP: Missing Consent Verification in OAuth Proxy Callback Facilitates Confused Deputy Vulnerabilities",
  "details" : "## Summary\nWhile 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.\n\n## Technical Details\nAn 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.\n\nAlthough this issue was verified in practice only for the *GitHubProvider*, a review of the source code, specifically the `OAuthProxy._handle_idp_callback` [function](https://github.com/jlowin/fastmcp/blob/ee5f465a82350e1c5a56c4a2b47cfdc4cd736e76/src/fastmcp/server/auth/oauth_proxy.py#L1762), 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.\n\nSkipping 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.\n\n## Steps to reproduce\n1. Set up an MCP server using the *GitHubProvider* integration.\n2. Connect a benign MCP client to this MCP server.\n3. Configure your default browser to route all traffic through an interception proxy such as Burp Suite.\n4. In a private browsing window or a second browser, log into the GitHub account used in step 2.\n5. As the attacker, connect a new (malicious) MCP client to the MCP server from step 1.\n6. When the browser opens for the attacker’s client, enable interception in your proxy.\n7. In the browser, confirm the consent prompt.\n8. In the proxy, forward all requests up to the authorization request to the GitHub authorization server.\n9. Copy the authorization URL and drop the intercepted request.\n10. Simulate luring the victim onto the URL by opening this URL in the browser window opened in step 4.\n11. Observe that the malicious client receives a valid authorization code and gains access to the benign MCP server using the victim’s GitHub account.\n\nIn 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.\n\n## Recommendation\n\nTo 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](https://mcp.mintlify.app/specification/2025-11-25/basic/security_best_practices#mitigation) for this vulnerability in the MCP specification.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "fastmcp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/PrefectHQ/fastmcp/security/advisories/GHSA-rww4-4w9c-7733"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jlowin/fastmcp/security/advisories/GHSA-rww4-4w9c-7733"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27124"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/PrefectHQ/fastmcp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-441" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-31T22:32:28Z",
    "nvd_published_at" : "2026-04-03T16:16:36Z"
  }
}