Description
A vulnerability exists in the MCP server's OAuth implementation of our MCP demo applications, where the redirect_uri parameter, encoded within the state parameter, is not properly validated.
The OAuth callback handler in the affected library fails to verify that the redirect_uri parameter received during the authorization callback matches the redirect_uri originally specified in the authorization request. This flaw allows an attacker to manipulate the redirect_uri to a malicious destination. Because the MCP server automatically approves new authorizations without requiring user interaction, successful exploitation can lead to account takeover and unauthorized access to the victim's MCP server resources.
Impact
An attacker who can cause a user to follow a crafted OAuth flow may obtain enough information to exchange the authorization code and perform actions against the service in the victim’s context.
Mitigation
Users are requested to upgrade to version SHA f7c11c8 or later of the demos.
We also recommend proper implementation of CSRF Tokens in the client application as shown in #297. For users who prefer using a coding agent, we have provided an MCP security document to achieve the same.
Credits
Disclosed responsibly by security researcher Peter Novotney.
References
Description
A vulnerability exists in the MCP server's OAuth implementation of our MCP demo applications, where the redirect_uri parameter, encoded within the state parameter, is not properly validated.
The OAuth callback handler in the affected library fails to verify that the redirect_uri parameter received during the authorization callback matches the redirect_uri originally specified in the authorization request. This flaw allows an attacker to manipulate the redirect_uri to a malicious destination. Because the MCP server automatically approves new authorizations without requiring user interaction, successful exploitation can lead to account takeover and unauthorized access to the victim's MCP server resources.
Impact
An attacker who can cause a user to follow a crafted OAuth flow may obtain enough information to exchange the authorization code and perform actions against the service in the victim’s context.
Mitigation
Users are requested to upgrade to version SHA f7c11c8 or later of the demos.
We also recommend proper implementation of CSRF Tokens in the client application as shown in #297. For users who prefer using a coding agent, we have provided an MCP security document to achieve the same.
Credits
Disclosed responsibly by security researcher Peter Novotney.
References