The Go MCP SDK used Go's standard encoding/json. Prior to version 1.4.0, the Model Context Protocol (MCP) Go SDK does not enable DNS rebinding protection by default for HTTP-based servers. When an HTTP-based MCP server is run on localhost without authentication with StreamableHTTPHandler or SSEHandler, a malicious website could exploit DNS rebinding to bypass same-origin policy restrictions and send requests to the local MCP server. This could allow an attacker to invoke tools or access resources exposed by the MCP server on behalf of the user in those limited circumstances. This issue has been patched in version 1.4.0.
CVE-2026-34742 is a DNS rebinding vulnerability in Go MCP SDK versions prior to 1.4.0 that affects HTTP-based servers running on localhost without authentication. An attacker can exploit this to bypass same-origin policy restrictions and invoke tools or access resources on the local MCP server. With a CVSS score of 8.1 and no exploit currently available, this poses a significant risk to organizations using vulnerable versions of the SDK, particularly those integrating MCP servers in development or production environments.
Immediate Actions:
1. Inventory all systems using Go MCP SDK and identify versions prior to 1.4.0
2. Disable or restrict HTTP-based MCP servers running on localhost without authentication
3. Implement network-level access controls to prevent external access to localhost services
Patching Guidance:
1. Upgrade Go MCP SDK to version 1.4.0 or later immediately
2. Review and test all MCP server implementations after patching
3. Verify DNS rebinding protection is enabled in the patched version
Compensating Controls (if immediate patching not possible):
1. Implement authentication on all HTTP-based MCP servers
2. Use firewall rules to restrict access to MCP servers to trusted networks only
3. Deploy reverse proxy with Host header validation
4. Implement DNS filtering to prevent rebinding attacks
5. Use HTTPS with certificate pinning instead of HTTP
Detection Rules:
1. Monitor for HTTP requests with mismatched Host headers to localhost services
2. Alert on DNS queries followed by rapid HTTP requests to 127.0.0.1 or localhost
3. Log and review all requests to MCP endpoints from external origins
4. Monitor for unusual tool invocations or resource access patterns
الإجراءات الفورية:
1. حصر جميع الأنظمة التي تستخدم Go MCP SDK وتحديد الإصدارات السابقة للإصدار 1.4.0
2. تعطيل أو تقييد خوادم HTTP-based MCP التي تعمل على localhost بدون مصادقة
3. تطبيق عناصر تحكم الوصول على مستوى الشبكة لمنع الوصول الخارجي إلى خدمات localhost
إرشادات التصحيح:
1. ترقية Go MCP SDK إلى الإصدار 1.4.0 أو أحدث فوراً
2. مراجعة واختبار جميع تطبيقات خادم MCP بعد التصحيح
3. التحقق من تفعيل حماية DNS rebinding في الإصدار المصحح
عناصر التحكم البديلة (إذا لم يكن التصحيح الفوري ممكناً):
1. تطبيق المصادقة على جميع خوادم HTTP-based MCP
2. استخدام قواعد جدار الحماية لتقييد الوصول إلى خوادم MCP للشبكات الموثوقة فقط
3. نشر reverse proxy مع التحقق من Host header
4. تطبيق تصفية DNS لمنع هجمات rebinding
5. استخدام HTTPS مع certificate pinning بدلاً من HTTP
قواعد الكشف:
1. مراقبة طلبات HTTP مع عدم تطابق Host headers لخدمات localhost
2. تنبيهات على استعلامات DNS متبوعة بطلبات HTTP سريعة إلى 127.0.0.1 أو localhost
3. تسجيل ومراجعة جميع الطلبات إلى نقاط نهاية MCP من أصول خارجية
4. مراقبة أنماط استدعاء الأدوات غير العادية أو أنماط الوصول إلى الموارد