mcp-framework versions <= 0.2.21 do not enforce a maximum message size on inbound JSON-RPC payloads. A single large request can exhaust heap memory and take a production MCP server offline.
mcp-framework is a popular TypeScript implementation of Anthropic's Model Context Protocol. Prior to 0.2.22, the HTTP transport reads the full request body into memory before validating its shape. Versions up to and including 0.2.21 have no cap on this read. An unauthenticated client can POST a multi-megabyte JSON body and trigger one of:
Source: thehackerwire.com/vulnerability/CVE-2026-39313 · related Anthropic MCP SDK arbitrary-command-execution disclosure published by OX Security.
Two non-destructive checks run on any target you paste into the MCP scanner:
Shield never sends malicious payloads. The probe is gentle and self-limiting.
npm install mcp-framework@^0.2.22 # or: pnpm up mcp-framework # verify: npm ls mcp-framework
import { Server } from 'mcp-framework';
new Server({
// fail-closed: reject anything over 256KB
maxMessageSize: 256 * 1024,
});
# nginx
client_max_body_size 512k;
# Caddy
request_body {
max_size 512KB
}
Even with a body cap, an attacker can still spam. Put the MCP server behind express-rate-limit, nginx limit_req, or Cloudflare Rate Limiting Rules. 60 req/min/IP is a reasonable default.
Re-run the Shield MCP scan after deploying. A clean result shows: