MCP Kotlin SDK's unbounded line buffer in StdioServerTransport/StdioClientTransport leads to memory exhaustion (DoS)
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(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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-53937
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 01:07 UTC · Revision 1
Source evidence
MCP Kotlin SDK's unbounded line buffer in StdioServerTransport/StdioClientTransport leads to memory exhaustion (DoS)
core-osv · Original sourcePublished 8 Sept 2026, 23:21 UTC
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(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.
osv:CVE-2026-53937
Complete source record
{
"id": "3132f5b019f2a1e19babd47109d33b9617b6700389fefebdecce0a168dd496c3",
"url": "https://osv.dev/vulnerability/CVE-2026-53937",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "MCP Kotlin SDK's unbounded line buffer in StdioServerTransport/StdioClientTransport leads to memory exhaustion (DoS)",
"summary": "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(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.",
"evidence": "osv:CVE-2026-53937",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2026-53937",
"aliases": [
"CVE-2026-53937",
"GHSA-74gp-qhv5-v493"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/modelcontextprotocol/kotlin-sdk",
"type": "GIT",
"events": [
{
"introduced": "9a70ceaaba99adab484655679ea12646e36c20eb"
},
{
"fixed": "6e6f80512fb8fcc9f3c031cfd693ccbcf9c4aaab"
},
{
"fixed": "b7eeeb12058099f980fa98d1468506489a6b5f32"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0.7.0"
},
{
"last_affected": "0.12.0"
}
],
"source": "DESCRIPTION"
},
{
"range": [
{
"fixed": "6e6f80512fb8fcc9f3c031cfd693ccbcf9c4aaab"
}
],
"source": "REFERENCES_COMMIT"
},
{
"range": [
{
"fixed": "b7eeeb12058099f980fa98d1468506489a6b5f32"
}
],
"source": "REFERENCES_TAG",
"original_tag": "0.13.0"
}
]
}
}
],
"versions": [
"0.12.0",
"0.11.1",
"0.11.0",
"0.9.0",
"0.8.3",
"0.8.1",
"0.8.0",
"0.7.7",
"0.7.6",
"0.7.5",
"0.7.4",
"0.7.2",
"0.7.2-alpha3",
"0.7.2-alpha2",
"0.7.2-alpha1",
"0.7.1",
"v0.7.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-53937.json"
}
}
],
"modified": "2026-10-28T02:30:32.327269090Z",
"provider": "osv",
"references": [
"https://github.com/modelcontextprotocol/kotlin-sdk/blob/6d5bac1/kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/ReadBuffer.kt",
"https://github.com/modelcontextprotocol/kotlin-sdk/releases/tag/0.13.0",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53937.json",
"https://github.com/modelcontextprotocol/kotlin-sdk/security/advisories/GHSA-74gp-qhv5-v493",
"https://nvd.nist.gov/vuln/detail/CVE-2026-53937",
"https://github.com/modelcontextprotocol/kotlin-sdk/commit/6e6f80512fb8fcc9f3c031cfd693ccbcf9c4aaab"
],
"provider_metadata": {
"cwe_ids": [
"CWE-400",
"CWE-770"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53937.json"
}
},
"related_cves": [
{
"value": "CVE-2026-53937",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 499400,
"published_at": "2026-09-08T23:21:46.554+00:00"
}