CVE-2026-53937 in Kotlin SDKinfo

Summary

by MITRE • 09/09/2026

MCP Kotlin SDK is the Kotlin Multiplatform software development kit for the Model Context Protocol. In versions 0.7.0 through 0.12.0, `ReadBuffer.append` in `kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/ReadBuffer.kt` writes every chunk of bytes received from the stdio transport into a `kotlinx.io.Buffer` with no size cap. Frames are extracted from that buffer only when a `\n` (0x0a) byte is observed. A peer that streams bytes without ever sending a newline causes the internal buffer to grow indefinitely until the JVM (or the surrounding host process) is OOM-killed. The leak is amplified by `StdioServerTransport` and `StdioClientTransport`, which both queue raw chunks through a `kotlinx.coroutines.channels.Channel<ByteArray>(Channel.UNLIMITED)` and then call `readBuffer.append(chunk)` without backpressure or size guard. This is a remote-pre-auth denial of service whenever an SDK stdio server's stdin is fed by an untrusted or attacker-controlled producer (for example: a host program that exec's the MCP server as a subprocess and pipes through bytes received from a network peer, or a sidecar wrapper that proxies bytes from an HTTP endpoint to the stdio transport). Version 0.13.0 fixes the issue.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 09/09/2026

The Model Context Protocol Kotlin SDK contains a critical resource exhaustion vulnerability within its standard input and output transport implementation, specifically affecting versions ranging from 0.7.0 through 0.12.0. This flaw resides in the ReadBuffer component located at kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/ReadBuffer.kt. The core technical deficiency is a lack of size constraints on the internal buffer used to accumulate incoming byte streams. When data arrives via the stdio transport, each chunk is appended directly into a kotlinx.io.Buffer without any mechanism to limit its growth or enforce backpressure. This design oversight creates a scenario where an unbounded memory allocation occurs continuously as long as input bytes are received, leading to severe system instability and potential service termination.

The operational mechanics of this vulnerability rely on the specific parsing logic employed by the SDK. Frames within the byte stream are extracted only when a newline character, represented by the hexadecimal value 0x0a or ASCII code 10, is encountered in the data flow. If an attacker or untrusted peer streams bytes continuously without ever including this delimiter, the ReadBuffer will persistently expand to accommodate every incoming chunk. Since there is no cap on the buffer size, memory consumption grows linearly with the volume of input data until the Java Virtual Machine exhausts its available heap space. This results in an Out Of Memory condition that typically triggers an OOM-kill by the host operating system or container runtime, effectively crashing the application process and causing a complete denial of service for any dependent services relying on this MCP server instance.

The severity of this issue is significantly amplified by the implementation details within StdioServerTransport and StdioClientTransport classes. These transport layers utilize kotlinx.coroutines.channels.Channel instances configured with Channel.UNLIMITED capacity to queue raw byte chunks before they are processed by the read buffer. This configuration explicitly removes any natural backpressure mechanisms that might otherwise slow down or halt data ingestion when downstream processing cannot keep pace. Consequently, an attacker can flood the system with high-volume data streams, rapidly depleting system resources without triggering any internal flow control signals. The vulnerability is classified as a remote-pre-authentication denial of service because it requires no authentication credentials; simply establishing a connection and sending unbounded byte sequences to the stdio endpoint is sufficient to exploit the flaw.

This attack vector is particularly dangerous in common deployment architectures where MCP servers are executed as subprocesses by host programs or wrapped in sidecar proxies that relay network traffic over HTTP to the standard input stream. In such configurations, an attacker controlling the upstream network source can directly influence the memory footprint of the MCP server process. The lack of authentication requirement means this vulnerability is easily exploitable against any publicly accessible endpoint that utilizes these vulnerable SDK versions for stdio-based communication. It represents a classic case of uncontrolled resource consumption due to missing input validation and size limits, aligning with CWE-789: Uncontrolled Memory Allocation in the Common Weakness Enumeration database.

To mitigate this vulnerability, organizations must immediately upgrade the Model Context Protocol Kotlin SDK to version 0.13.0 or later, where the issue has been resolved by implementing appropriate buffer sizing and backpressure mechanisms. For environments that cannot yet patch the dependency, defensive coding practices should be adopted at the application layer. This includes wrapping the stdio input stream with a custom reader that enforces strict size limits on individual frames or total accumulated data before passing it to the SDK components. Additionally, monitoring system memory usage for MCP server processes can provide early detection of such attacks, allowing for automated restarts or alerts before complete service failure occurs. Security teams should also review any proxy layers between network clients and the MCP stdio endpoint to ensure they implement rate limiting and payload size restrictions as an additional defense-in-depth measure against resource exhaustion attacks.

Responsible

GitHub M

Reservation

06/11/2026

Disclosure

09/09/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!