Skip to content

Commit f04d282

Browse files
1 parent 7aa3eb5 commit f04d282

2 files changed

Lines changed: 120 additions & 11 deletions

File tree

advisories/unreviewed/2026/03/GHSA-q5mh-72xg-628w/GHSA-q5mh-72xg-628w.json renamed to advisories/github-reviewed/2026/03/GHSA-q5mh-72xg-628w/GHSA-q5mh-72xg-628w.json

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,62 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-q5mh-72xg-628w",
4-
"modified": "2026-03-25T15:31:29Z",
4+
"modified": "2026-03-27T18:38:03Z",
55
"published": "2026-03-25T15:31:29Z",
66
"aliases": [
77
"CVE-2026-26830"
88
],
9-
"details": "pdf-image (npm package) through version 2.0.0 allows OS command injection via the pdfFilePath parameter. The constructGetInfoCommand and constructConvertCommandForPage functions use util.format() to interpolate user-controlled file paths into shell command strings that are executed via child_process.exec()",
9+
"summary": "pdf-image has an OS Command Injection Vulnerability through its pdfFilePath parameter",
10+
"details": "pdf-image (npm package) through version 2.0.0 allows OS command injection via the pdfFilePath parameter. The constructGetInfoCommand and constructConvertCommandForPage functions use util.format() to interpolate user-controlled file paths into shell command strings that are executed via child_process.exec().",
1011
"severity": [
1112
{
1213
"type": "CVSS_V3",
1314
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
1415
}
1516
],
16-
"affected": [],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "npm",
21+
"name": "pdf-image"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"last_affected": "2.0.0"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
1738
"references": [
1839
{
1940
"type": "ADVISORY",
2041
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-26830"
2142
},
2243
{
23-
"type": "WEB",
44+
"type": "PACKAGE",
2445
"url": "https://github.com/mooz/node-pdf-image"
2546
},
2647
{
2748
"type": "WEB",
2849
"url": "https://github.com/zebbernCVE/CVE-2026-26830"
29-
},
30-
{
31-
"type": "WEB",
32-
"url": "https://www.npmjs.com/package/pdf-image"
3350
}
3451
],
3552
"database_specific": {
36-
"cwe_ids": [],
53+
"cwe_ids": [
54+
"CWE-78",
55+
"CWE-94"
56+
],
3757
"severity": "CRITICAL",
38-
"github_reviewed": false,
39-
"github_reviewed_at": null,
58+
"github_reviewed": true,
59+
"github_reviewed_at": "2026-03-27T18:38:03Z",
4060
"nvd_published_at": "2026-03-25T15:16:38Z"
4161
}
4262
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-qvqr-5cv7-wh35",
4+
"modified": "2026-03-27T18:36:45Z",
5+
"published": "2026-03-27T18:36:45Z",
6+
"aliases": [
7+
"CVE-2026-33946"
8+
],
9+
"summary": "MCP Ruby SDK: Insufficient Session Binding Allows SSE Stream Hijacking via Session ID Replay",
10+
"details": "### Summary\n\nThe Ruby SDK's [streamable_http_transport.rb](https://github.com/modelcontextprotocol/ruby-sdk/blob/main/lib/mcp/server/transports/streamable_http_transport.rb) implementation contains a session hijacking vulnerability. An attacker who obtains a valid session ID can completely hijack the victim's Server-Sent Events (SSE) stream and intercept all real-time data.\n\n### Details\n**Root Cause**\nThe StreamableHTTPTransport implementation stores only one SSE stream object per session ID and lacks:\n\n- Session-to-user identity binding\n- Ownership validation when establishing SSE connections\n- Protection against multiple simultaneous connections to the same session\n\n### PoC\n\n#### Vulnerable Code\n\n**File**: streamable_http_transport.rb - [L336-L339](https://github.com/modelcontextprotocol/ruby-sdk/blob/main/lib/mcp/server/transports/streamable_http_transport.rb#L336-L339):\n\n```\ndef store_stream_for_session(session_id, stream)\n @mutex.synchronize do\n if @sessions[session_id]\n @sessions[session_id][:stream] = stream # OVERWRITES existing stream\n else\n stream.close\n end\n end\nend\n```\n#### Attack Scenario\n**Step 1**: Legitimate Session Establishment\n```\nPOST / (initialize) → receives session_id: \"abc123\"\nGET / with Mcp-Session-Id: abc123 → SSE stream connected\n```\nStep 2: Session ID Compromise\n\n- An attacker obtains the session ID through various means (out of scope for this analysis)\n\n**Step 3**: Stream Hijacking\n\n```\nGET / with Mcp-Session-Id: abc123 \n@sessions[\"abc123\"][:stream] = attacker_stream `# Victim's stream is REPLACED (silently disconnected)\n```\n\n**Step 4**: Data Interception\n\n- ALL subsequent tool responses/notifications go to the attacker\n- The legitimate user receives no data and has no indication of the hijacking\n\n#### Technical Details\n\nThe vulnerability happens:\n\n**Client 1 connects (GET request)**\n\n```\nproc do |stream1| # ← Rack server provides stream1 for client 1\n @sessions[session_id][:stream] = stream1 # Stored\nend\n```\n\n**Client 2 connects with SAME session ID (Attack!)**\n```\nproc do |stream2| # ← Rack provides stream2 for client 2\n @sessions[session_id][:stream] = stream2 # REPLACES stream1!\nend\n```\n\n**Now when the server sends notifications:**\n\n```\n@sessions[session_id][:stream].write(data) # Goes to stream2 (attacker!)\n# stream1 (victim) receives nothing\n```\n\n**Comparison: Python SDK Protection**\n\nThe Python SDK prevents this vulnerability by rejecting duplicate SSE connections:\n\n**Refer**: https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/streamable_http.py#L680-L685\n\n```\nif GET_STREAM_KEY in self._request_streams: # pragma: no cover\n response = self._create_error_response(\n \"Conflict: Only one SSE stream is allowed per session\",\n HTTPStatus.CONFLICT,\n )\n```\n\nWhen a duplicate connection attempt is detected, the Python SDK returns an HTTP 409 Conflict error, protecting the existing connection.\n\n**Recommended Mitigations**\n**For SDK Maintainers**\n\n- Implement User Binding: All SDKs should bind session IDs to authenticated user identities where possible. Currently only, go-sdk and csharp-sdk do user binding.\n- **Ruby SDK**: Prevent Duplicate Connections: Implement checks to reject or handle multiple simultaneous connections to the same session\n- **Improve Documentation**: Provide clear guidance on secure session management implementation for SDK consumers\n\n### Steps To Reproduce:\n\nPlease find attached two python client files demonstrating the attack\n\n**Terminal 1:**\n`ruby streamable_http_server.rb`\n\nMakes use of https://github.com/modelcontextprotocol/ruby-sdk/blob/main/examples/streamable_http_server.rb\nThis server has a tool call notification_tool which the clients call\n\n**Terminal 2:**\n\n`python3 legitimate_client_ruby_server.py`\n\n**What happens:**\n\n- The client connects and prints the session ID\n- Press Enter to start the SSE stream\n- Notifications start appearing every 3 seconds as the client makes a tool call\n\n**Terminal 3 (while the legitimate client is running):**\n\n`python3 attacker_client_ruby_server.py <SESSION_ID>`\n\nReplace `<SESSION_ID>` with the ID from Terminal 2.\n\n**What happens immediately:**\n\n- Terminal 2 (Legitimate): Stops receiving notifications, shows disconnect message\n- Terminal 3 (Attacker): Starts receiving ALL the tool call responses\n\n### Impact\nWhile the absence of user binding may not pose immediate risks if session IDs are not used to store sensitive data or state, the fundamental purpose of session IDs is to maintain stateful connections. If the SDK or its consumers utilize session IDs for sensitive operations without proper user binding controls, this creates a potential security vulnerability. For example: In the case of the Ruby SDK, the attacker was able to hijack the stream and receive all the tool responses belonging to the victim. The tool responses can be sensitive confidential data.\n\n### Additional Details\n#### Session Hijacking Protection in MCP Implementations\nThe MCP specification recommends - \"MCP servers SHOULD bind session IDs to user-specific information\".\n\n#### Current Implementation Status Across SDKs\n\nOf the 10 official MCP SDKs, only the following implementations bind session IDs to user-specific information:\n\n1. csharp-sdk - https://github.com/modelcontextprotocol/csharp-sdk/blob/main/src/ModelContextProtocol.AspNetCore/SseHandler.cs#L93-L97\n2. Go-sdk - https://github.com/modelcontextprotocol/go-sdk/blob/main/mcp/streamable.go#L281C1-L288C2\n\n[attacker_client_ruby_server.py](https://github.com/user-attachments/files/25408485/attacker_client_ruby_server.py)\n[legitimate_client_ruby_server.py](https://github.com/user-attachments/files/25408486/legitimate_client_ruby_server.py)\nThe remaining SDKs do not implement session-to-user binding. Most implementations only verify that a session ID exists, without validating ownership. Additionally, SDK documentation does not provide clear guidance on implementing secure session management, leaving security responsibilities unclear for SDK consumers.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "RubyGems",
21+
"name": "mcp"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "0.9.2"
32+
}
33+
]
34+
}
35+
],
36+
"database_specific": {
37+
"last_known_affected_version_range": "<= 0.9.1"
38+
}
39+
}
40+
],
41+
"references": [
42+
{
43+
"type": "WEB",
44+
"url": "https://github.com/modelcontextprotocol/ruby-sdk/security/advisories/GHSA-qvqr-5cv7-wh35"
45+
},
46+
{
47+
"type": "WEB",
48+
"url": "https://github.com/modelcontextprotocol/ruby-sdk/commit/db40143402d65b4fb6923cec42d2d72cb89b3874"
49+
},
50+
{
51+
"type": "WEB",
52+
"url": "https://hackerone.com/reports/3556146"
53+
},
54+
{
55+
"type": "WEB",
56+
"url": "https://github.com/modelcontextprotocol/csharp-sdk/blob/main/src/ModelContextProtocol.AspNetCore/SseHandler.cs#L93-L97"
57+
},
58+
{
59+
"type": "WEB",
60+
"url": "https://github.com/modelcontextprotocol/go-sdk/blob/main/mcp/streamable.go#L281C1-L288C2"
61+
},
62+
{
63+
"type": "WEB",
64+
"url": "https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/streamable_http.py#L680-L685"
65+
},
66+
{
67+
"type": "PACKAGE",
68+
"url": "https://github.com/modelcontextprotocol/ruby-sdk"
69+
},
70+
{
71+
"type": "WEB",
72+
"url": "https://github.com/modelcontextprotocol/ruby-sdk/blob/main/examples/streamable_http_server.rb"
73+
},
74+
{
75+
"type": "WEB",
76+
"url": "https://github.com/modelcontextprotocol/ruby-sdk/releases/tag/v0.9.2"
77+
}
78+
],
79+
"database_specific": {
80+
"cwe_ids": [
81+
"CWE-384",
82+
"CWE-639"
83+
],
84+
"severity": "HIGH",
85+
"github_reviewed": true,
86+
"github_reviewed_at": "2026-03-27T18:36:45Z",
87+
"nvd_published_at": null
88+
}
89+
}

0 commit comments

Comments
 (0)