rmcp OAuth resource parameter not validated, allowing token theft
What this means
An attacker can set up a fake MCP server that tricks the rmcp library into stealing OAuth access tokens meant for a legitimate server. These tokens could be used to impersonate the victim, access their data, or perform actions on their behalf on the legitimate service.
SecurityElites Manager Brief: the decision in one minute
The rmcp library fails to validate OAuth server identity, allowing attackers to intercept access tokens. This is a critical flaw that requires immediate upgrade to version 2.0.0. Any application using an earlier version must be patched and any tokens issued before the patch must be revoked.
| SecurityElites Fix-First Score | 43 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | Infrastructure and security teams managing MCP client deployments. |
| Likely effort | About 15 minutes per service: a version bump in package managers and a restart. Longer if you need to audit logs to see if the vulnerability was used. |
Questions to ask your team or supplier
- Do we know which services and deployments use rmcp, and have we confirmed they are all running version 2.0.0 or later?
- Have we checked OAuth provider and application logs for suspicious token activity or unusual server connections before and after this vulnerability was disclosed?
- What is our process for validating that MCP servers are legitimate before connecting, and do we have network controls in place to prevent connections to unexpected servers?
Message you can forward to the owning team
Security notice: rmcp OAuth resource parameter not validated, allowing token theft (CVE-2026-63127)
Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to rmcp 2.0.0 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-63127-rmcp-oauth-resource-parameter-not-validated-allowing-token-theft/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01880What is at stake in your AI setup
- OAuth access tokens and API keys for AI services connected to the legitimate MCP server—an attacker could use stolen tokens to call AI APIs and run up compute bills.
- Prompts, chat history, and system instructions sent over the OAuth-protected MCP connection—these could be exfiltrated or modified by an attacker with a stolen token.
- Tools and external systems the MCP client is authorized to access via OAuth—compromised tokens allow an attacker to invoke these on behalf of the victim.
Who is exposed
- Teams running any version of rmcp before 2.0.0
- Services that connect to MCP servers using rmcp for OAuth authentication
- Any deployed system where an attacker can point the client to a malicious MCP server
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| rmcp crates.io | Every version before 2.0.0 | 2.0.0 or later |
Am I affected?
Enter the version you run. Nothing you type is stored.
SecurityElites Developer Brief: the technical picture
| Is it being attacked | Working attack code is public, so expect attacks to follow |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | None. No login is needed |
| Does a person have to do something | Yes. Someone has to click, open or approve something |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | Limited |
| Risk of: the service being taken down | None |
| Can attackers automate it at scale | No, according to CISA. Each target needs manual work |
| How much control an attacker gains | Partial control, according to CISA |
Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
Kind of coding mistake
- CWE-345
If you cannot upgrade today
- Until you can upgrade, limit network access from the affected service to only the legitimate MCP server IP addresses and hostnames you control. Use a firewall or network ACL to block connections to unknown servers.
- Rotate all OAuth tokens and credentials used by the affected service, and monitor their usage closely for any anomalies.
- Isolate or temporarily disable the affected service if you cannot upgrade immediately and suspect active compromise.
Signs it may already have been used against you
- Check OAuth provider logs for access token grants from unexpected source IPs or time zones between the service startup and now.
- Search application logs for connection attempts to MCP servers with hostnames or IPs that do not match your known legitimate MCP server list.
- Review OAuth token usage patterns: look for tokens being used to access data or APIs they should not normally access.
- Check DNS and network logs for unusual outbound connections from the affected service to unfamiliar domains around the time of token issuance.
Log searches to start from
OAuth token grants from unexpected source IP (adapt source_ip and timestamp fields to your log schema)Splunk
index=oauth_provider event=token_issued | stats earliest(timestamp) as first_grant by source_ip, client_id | where first_grant < now - 30dMCP client connections to unusual hostnames (adapt host and destination fields to your log schema)Elastic
process.name:rmcp AND network.direction:outbound AND NOT destination.hostname:(your-legitimate-mcp-server.com) | stats count by destination.hostname, source.ipWritten with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.
SecurityElites Fix Guide: step by step
- Find where rmcp is installedList all services and applications that depend on the rmcp crate. Check your Cargo.toml files, dependency manifests, and runtime package lists for any reference to rmcp.
- Check the current versionFor each service, confirm which version of rmcp is installed. Run cargo tree or check lock files to see the exact version number.
- Review access logs and token usageBefore upgrading, check OAuth provider logs and application logs for any suspicious token issuance or use in the past 30 days. Look for tokens granted from unexpected IP addresses or to unexpected accounts.
- Upgrade rmcp to version 2.0.0 or laterUpdate the rmcp dependency to 2.0.0 in all affected Cargo.toml files. Run cargo update and re-test to ensure the application still builds and runs.
- Restart affected servicesRestart all applications and services that use rmcp to load the new version into memory.
- Verify the upgradeConfirm that the installed version is now 2.0.0 or later by running cargo tree or checking the runtime version. The service should start and connect to MCP servers without errors.
- Revoke and reissue OAuth tokensIf logs show suspicious token activity, revoke all OAuth tokens issued before the upgrade. Reissue new tokens for legitimate services to ensure only current, trusted credentials are in use.
- Review MCP server connectionsConfirm that all MCP servers your services connect to are legitimate and under your control or from trusted third parties. Remove any configurations pointing to unknown or attacker-controlled servers.
How to confirm it is fixed: Confirm that all services running rmcp report version 2.0.0 or later when queried, and that they can successfully connect to legitimate MCP servers without errors.
SecurityElites Quick Fixes: copy and paste
Upgrade the crateupgrade
cargo update -p rmcp --precise 2.0.0Check rmcp version in Cargo.tomlfor this issue
[dependencies]
rmcp = "2.0.0"List rmcp version in Cargo.lock or dependency treefor this issue
cargo tree | grep rmcpTest in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.
Let your AI coding assistant do the upgrade
Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.
Instruction for your coding assistant
You are helping me fix a security vulnerability (CVE-2026-63127) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n - rmcp (crates.io): must be 2.0.0 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.SecurityElites Incident Drill: could your team handle this?
Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.
Ticket for your backlog
Paste into Jira, GitHub Issues or any tracker that reads Markdown.
Ready-made ticket
## rmcp OAuth resource parameter not validated, allowing token theft (CVE-2026-63127)
**Severity:** High | **SE Fix-First Score:** 43/100 | **Fix window:** Within 30 days
**Record:** SE-AIV-01880 https://securityelites.com/ai-vulnerabilities/cve-2026-63127-rmcp-oauth-resource-parameter-not-validated-allowing-token-theft/
### Why this matters
An attacker can set up a fake MCP server that tricks the rmcp library into stealing OAuth access tokens meant for a legitimate server. These tokens could be used to impersonate the victim, access their data, or perform actions on their behalf on the legitimate service.
### What to do
1. Find where rmcp is installed
2. Check the current version
3. Review access logs and token usage
4. Upgrade rmcp to version 2.0.0 or later
5. Restart affected services
6. Verify the upgrade
7. Revoke and reissue OAuth tokens
8. Review MCP server connections
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-63127-rmcp-oauth-resource-parameter-not-validated-allowing-token-theft/
### Done when
- [ ] rmcp is at 2.0.0 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm that all services running rmcp report version 2.0.0 or later when queried, and that they can successfully connect to legitimate MCP servers without errors.
- [ ] Logs were checked for signs of earlier use
SecurityElites Fix Tracker
Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.
Related vulnerabilities
In the same software
- rmcp: Session memory leak on invalid requests High · CVE-2026-63128
The same kind of mistake in other AI tools
- gemini-mcp-tool can be tricked to run commands without approval High · CVE-2026-142216
- jncraton languagemodels can run attacker code via model templates High · CVE-2026-139989
- DeepSeek-AI DeepGEMM can write data outside memory bounds in attention code High · CVE-2026-139817
- NLTK can run untrusted dot command from writable directory High · CVE-2026-128134
- n8n workflow expressions can run code with full server access High · CVE-2026-65591
Change history
- 16 Sep 2026: Made public
- 2 Dec 2026: Published
Official record
### Summary The `rmcp` library does not validate the `resource` parameter in OAuth Protected Resource metadata (RFC 9728), allowing a malicious MCP server to redirect OAuth flows to a legitimate authorization server and steal the resulting access tokens.### Details RFC 9728 specifies two MUST requirements for resource parameter validation: - Section 7.3: the client MUST ensure that the resource identifier URL it is using as the prefix for the metadata request exactly matches the `resource` value in the returned metadata document. - Section 3.3: if the `resource` value returned is not identical to the URL the client used, the data MUST NOT be used.In the current implementation (`crates/rmcp/src/transport/auth.rs`), the `ResourceServerMetadata` struct (lines 390–394) does not include a resource field: ```rust struct ResourceServerMetadata { authorization_server: Option<String>, authorization_servers: Option<Vec<String>>, scopes_supported: Option<Vec<String>>, } ``` And discover_oauth_server_via_resource_metadata() (lines 1446–1465) proceeds without any resource URL validation.#### Recommended fix 1. Add the `resource` field to the struct: ```rust struct ResourceServerMetadata { resource: Option<String>, // RFC 9728 REQUIRED field authorization_server: Option<String>, authorization_servers: Option<Vec<String>>, scopes_supported: Option<Vec<String>>, } ``` 2. Add validation logic after fetching metadata: ```rust let Some(resource_metadata) = self .fetch_resource_metadata_from_url(&resource_metadata_url) .await? else { return Ok(None); }; // RFC 9728: validate that the resource identifier matches our target server if let Some(resource) = &resource_metadata.resource { if resource.trim_end_matches('/') != self.base_url.as_str().trim_end_matches('/') { return Err(AuthError::MetadataError(format!( "Resource metadata mismatch: expected '{}', got '{}'", self.base_url, resource ))); } } ```### PoC1. Attacker sets up a malicious MCP server at `fake-mcp.com/mcp`. 2. At `fake-mcp.com/mcp/.well-known/oauth-protected-resource`, the attacker serves metadata declaring: - resource: `real-mcp.com/mcp` (the legitimate server) - authorization_servers: the legitimate authorization server(s) of `real-mcp.com/mcp`3. Victim configures any MCP client using `rmcp` to connect to `fake-mcp.com/mcp`.4. `rmcp` fetches the protected resource metadata and, without validating that the `resource` field (`real-mcp.com/mcp`) differs from the configured server (`fake-mcp.com/mcp`), initiates an OAuth flow with the legitimate authorization server. 5. The victim sees a legitimate authorization prompt and completes the flow. 6. The resulting access token — valid for `real-mcp.com/mcp` — is sent to `fake-mcp.com/mcp` in subsequent requests. 7. The attacker captures the token and can impersonate the victim on `real-mcp.com/mcp`.### Impact This is an access token theft vulnerability via OAuth resource metadata spoofing. All MCP clients built on `rmcp` that rely on OAuth-protected MCP servers are affected. An attacker who tricks a user into connecting to a malicious MCP server can steal valid access tokens for any legitimate MCP server, enabling full impersonation of the victim.#### Credit Jian Cui, Minsun Shim, Zhou Li, Xiaojing Liao University of Illinois Urbana-Champaign (UIUC) University of California, Irvine (UCI)
Weakness type: CWE-345
Use this record in your own tools
Get this record as JSON
curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-63127For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker
The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 2 Dec 2026. Read the vendor advisory before changing a production system.