rmcp: Session memory leak on invalid requests

HighSE Fix-First Score 43/100CVE-2026-63128SE-AIV-01883Missing or broken access controlAI softwareMade public 17 Sep 2026

Download as PDF

What this means

An attacker can send many simple requests to a rmcp server and leak memory, causing the server to run out of RAM and stop working. No login is needed. A single attacker can cause the server to crash in hours or days.

SecurityElites Manager Brief: the decision in one minute

An attacker can crash rmcp servers by sending many simple requests that leak memory. Upgrade to version 2.0.0 immediately.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform or infrastructure team that runs rmcp services.
Likely effortAbout 15 minutes: version bump, build, and restart. Finding all affected services and monitoring them afterward could add an hour.

Questions to ask your team or supplier

  • Which services in production depend on rmcp, and how quickly can they be restarted if needed?
  • Do we have monitoring and alerting set up to detect when a service's memory usage grows unchecked?
  • Can we test the upgrade in a staging or test environment first to make sure it does not break any integrations?

Message you can forward to the owning team

Security notice: rmcp: Session memory leak on invalid requests (CVE-2026-63128)

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-63128-rmcp-session-memory-leak-on-invalid-requests/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01883

What is at stake in your AI setup

  • Compute resources: a memory leak causes the server to consume all available RAM, running up the bill for cloud compute and preventing other services from running.
  • Service availability: the rmcp service crashes from memory exhaustion, taking down any AI agent or application that depends on it.

Map where your company uses AI

Who is exposed

  • Any rmcp server reachable over HTTP from the internet or untrusted networks.
  • Services behind a firewall that accept connections from internal users who may be compromised.
  • Development and test rmcp servers that run continuously.

Upgrades you need

SoftwareAffected versionsMove to
rmcp
crates.io
Every version before 2.0.02.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 attackedWorking attack code is public, so expect attacks to follow
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededNone. No login is needed
Does a person have to do somethingNo. It works without anyone clicking or opening anything
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readNone
Risk of: data or settings being changedNone
Risk of: the service being taken downHigh
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
How much control an attacker gainsPartial control, according to CISA

Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Kind of coding mistake

  • CWE-400: resources can be exhausted
  • CWE-401
  • CWE-772

If you cannot upgrade today

  • Temporarily block HTTP POST requests at the network layer (firewall, load balancer, or reverse proxy) if the service cannot be upgraded immediately.
  • Restart the rmcp service every few hours if memory growth is observed, as a temporary measure only while preparing the upgrade.
  • Limit the rate of POST requests per IP address at the firewall or proxy to slow the leak, but do not rely on this as a fix.

Signs it may already have been used against you

  • Memory usage of the rmcp service grows continuously over hours or days without stopping.
  • The service crashes with an out-of-memory error or is killed by the OS.
  • HTTP logs show many POST requests arriving from a single IP address or a small set of IPs, with unusual error responses in quick succession.
  • The service process consumes 50%, 75%, or 90% of available RAM while handling ordinary traffic load.

Log searches to start from

Many failed POST requests to rmcp endpoint (adjust index, host, and path names)Elastic

index=http_logs http.method:POST path:*/rmcp/* http.status:[400 TO 499] | stats count by source.ip | sort - count

Written 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

  1. Find where rmcp is usedSearch your code for rmcp dependencies in Cargo.toml files. Run `grep -r 'rmcp' --include='Cargo.toml'` to find all projects that use it. Check which of these projects are deployed and running.
  2. Check the current versionIn each project using rmcp, run `cargo tree | grep rmcp` to see which version is currently installed. Any version before 2.0.0 is affected.
  3. Update rmcp to version 2.0.0Edit the Cargo.toml file for each affected project and change the rmcp version to 2.0.0 or later. Run `cargo update rmcp` to fetch the fixed version.
  4. Rebuild the serviceRun `cargo build --release` (or your normal build command) for each project. Test the build in a development environment to make sure it compiles and starts without errors.
  5. Deploy the fixed versionDeploy the newly built service to production following your normal deployment process. Restart any running rmcp services to load the new code.
  6. Verify the fix is in placeAfter restart, run `cargo tree | grep rmcp` on the deployed service to confirm version 2.0.0 or later is now running. Check the service logs to confirm it started without errors.
  7. Check for memory exhaustion in logsReview the service logs and monitoring data from before the upgrade for signs of memory growing without bound or the service crashing. If you see evidence the service was under attack, preserve logs for investigation.
  8. Monitor after the fixWatch the service's memory usage for 24 hours after the upgrade to confirm it stays stable and no longer grows. If memory still grows, the service may still be under attack or another issue exists.

How to confirm it is fixed: Run `cargo tree | grep rmcp` and confirm the installed version is 2.0.0 or later.

SecurityElites Quick Fixes: copy and paste

Upgrade the crateupgrade

cargo update -p rmcp --precise 2.0.0

Check installed rmcp versionfor this issue

cargo tree | grep rmcp

Require sign-in with nginx in front of the servicegeneral hardening

location / {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
    proxy_pass http://127.0.0.1:8080;
}

Test 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-63128) 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.

What is the attack and why does it cause memory to leak?A good answer: An attacker sends many invalid JSON-RPC requests over HTTP; the rmcp server creates a session for each one but never releases it because the request fails validation before the cleanup code runs.
How would you know if your service was targeted by this attack before you upgraded?A good answer: Memory usage would climb steadily over hours or days, and the service might crash with an out-of-memory error; HTTP logs would show many failed POST requests in a short time.
What versions of rmcp are safe from this bug?A good answer: Only version 2.0.0 and later; any version before 2.0.0 is affected.
Can a firewall rule fully protect us without upgrading?A good answer: No; a firewall rule can slow an attack but not prevent it, and the attack requires no authentication so blocking is difficult; upgrading is the only real fix.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## rmcp: Session memory leak on invalid requests (CVE-2026-63128)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01883 https://securityelites.com/ai-vulnerabilities/cve-2026-63128-rmcp-session-memory-leak-on-invalid-requests/

### Why this matters
An attacker can send many simple requests to a rmcp server and leak memory, causing the server to run out of RAM and stop working. No login is needed. A single attacker can cause the server to crash in hours or days.

### What to do
1. Find where rmcp is used
2. Check the current version
3. Update rmcp to version 2.0.0
4. Rebuild the service
5. Deploy the fixed version
6. Verify the fix is in place
7. Check for memory exhaustion in logs
8. Monitor after the fix

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-63128-rmcp-session-memory-leak-on-invalid-requests/

### Done when
- [ ] rmcp is at 2.0.0 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Run `cargo tree | grep rmcp` and confirm the installed version is 2.0.0 or later.
- [ ] 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.

Sign in to track this fix

Change history

  • 16 Sep 2026: Made public
  • 2 Dec 2026: Published

Official record

### SummaryAn unauthenticated remote attacker can leak one entry per HTTP request out of the in-memory session table of `LocalSessionManager` by sending a well-formed JSON-RPC `POST` that is *not* an `InitializeRequest`. The Streamable HTTP server's `handle_post` allocates the session **before** it validates the body, then early-returns on the validation failure without calling `close_session`. The `LocalSessionHandle` (and the tokio mpsc channel internals it holds) is never released for the remainder of the process's lifetime — turning a ~250-byte request into a permanent ~400–550-byte server-side allocation that scales linearly with request volume and eventually exhausts memory. In the verified reproduction below, a single Python client sustains over 2 000 leak requests per second; that translates to roughly **170 million leaked entries per day**, equivalent to **≈75 GB** of resident memory just from the session table.### DetailsThe bug lives in `crates/rmcp/src/transport/streamable_http_server/tower.rs` inside `StreamableHttpService::handle_post`. The relevant slice of `1.7.0` source (lines `1126–1170`) is:```rust } else { let (session_id, transport) = self .session_manager .create_session() // (★) .await .map_err(internal_error_response("create session"))?; // ...capture init params if a SessionStore is configured... if let ClientJsonRpcMessage::Request(req) = &mut message { let ClientRequest::InitializeRequest(init_req) = &req.request else { return Err(unexpected_message_response("initialize request")); // (A) }; validate_header_matches_init_body( // (B) &part.headers, init_req.params.protocol_version.as_str(), Some(req.id.clone()), )?; req.request.extensions_mut().insert(part); } else { return Err(unexpected_message_response("initialize request")); // (C) } let service = self .get_service() // (D) .map_err(internal_error_response("get service"))?; Self::spawn_session_worker( // (★★) self.session_manager.clone(), session_id.clone(), service, transport, None, ); // ...persist to external store, send response... } ```Two facts make this unsafe:1. `(★)` inserts a `LocalSessionHandle` into `LocalSessionManager.sessions` (a `tokio::sync::RwLock<HashMap<SessionId, LocalSessionHandle>>`) and spawns a `LocalSessionWorker` task. 2. `(★★)` `spawn_session_worker` is the **only** code path in the entire transport (besides a client-initiated HTTP `DELETE` reaching `handle_delete`) that ever invokes `self.session_manager.close_session(&session_id)`.Therefore the four early-returns `(A)`, `(B)`, `(C)`, and `(D)` all skip the cleanup. What happens concretely after such an early return:- The local `transport: WorkerTransport<LocalSessionWorker>` goes out of scope; its `_drop_guard` cancels the worker's `CancellationToken`. - The worker, which had been awaiting `event_rx.recv()`, exits within milliseconds via `WorkerQuitReason::Cancelled`. Its `event_rx` receiver is dropped. - `LocalSessionHandle.event_tx` (the `Sender` half of the same mpsc channel) is still alive **because it is owned by the HashMap entry that nothing ever removes**. The channel's `Inner` (sized to `channel_capacity = 16` by default) remains pinned in memory.Because the worker has already exited, the `SessionConfig::keep_alive` and `init_timeout` cleanup paths cannot run either — they only fire from inside a running worker. The leak is therefore **permanent for the lifetime of the server process** and grows unbounded with sustained traffic.The bug is reachable with **zero authentication**, the **default** `StreamableHttpServerConfig`, and the **default** `Loc

Weakness type: CWE-400, CWE-401, CWE-772

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-63128

For 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.