A vulnerability was detected in NousResearch hermes-agent up to 2026.4.16. The affected element is an unknown function of the component Slack Agent/Mattermost Agent. The manipulation of the argument format_message results in escaping of output. The attack can be executed remotely. The exploit is now public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
CVE-2026-9354 is a medium-severity output escaping vulnerability in NousResearch hermes-agent affecting Slack and Mattermost integrations. The vulnerability allows remote attackers to manipulate the format_message argument, potentially leading to injection attacks or information disclosure through improperly escaped output. With public exploit availability and no vendor patch, immediate mitigation is required for organizations using these chat integrations.
Immediate Actions:
1. Identify all instances of NousResearch hermes-agent version 2026.4.16 or earlier in your environment
2. Disable or isolate Slack/Mattermost Agent components until patching is available
3. Review chat logs for suspicious format_message manipulations or unusual output patterns
4. Implement input validation on all format_message parameters
Compensating Controls:
1. Deploy Web Application Firewall (WAF) rules to detect and block format_message injection attempts
2. Implement strict output encoding/escaping at the application layer for all chat integrations
3. Enable enhanced logging and monitoring for Slack/Mattermost agent activities
4. Restrict API access to hermes-agent components using network segmentation
5. Apply principle of least privilege to service accounts used by agents
Detection Rules:
1. Monitor for unusual characters or escape sequences in format_message parameters
2. Alert on format_message values containing HTML/XML tags or script content
3. Track failed message formatting attempts and subsequent error messages
4. Monitor for unexpected output in Slack/Mattermost channels from agent sources
الإجراءات الفورية:
1. تحديد جميع نسخ NousResearch hermes-agent الإصدار 2026.4.16 أو الأقدم في بيئتك
2. تعطيل أو عزل مكونات Slack/Mattermost Agent حتى يتوفر التصحيح
3. مراجعة سجلات الدردشة للتحقق من معالجات format_message المريبة أو أنماط الإخراج غير المعتادة
4. تطبيق التحقق من صحة الإدخال على جميع معاملات format_message
الضوابط البديلة:
1. نشر قواعد جدار الحماية (WAF) للكشف عن محاولات حقن format_message وحجبها
2. تطبيق ترميز/هروب صارم للإخراج على مستوى التطبيق لجميع تكاملات الدردشة
3. تفعيل السجلات المحسّنة والمراقبة لأنشطة وكيل Slack/Mattermost
4. تقييد وصول API لمكونات hermes-agent باستخدام تقسيم الشبكة
5. تطبيق مبدأ أقل امتياز على حسابات الخدمة المستخدمة من قبل الوكلاء
قواعد الكشف:
1. مراقبة الأحرف غير المعتادة أو تسلسلات الهروب في معاملات format_message
2. التنبيه على قيم format_message التي تحتوي على علامات HTML/XML أو محتوى البرنامج النصي
3. تتبع محاولات تنسيق الرسائل الفاشلة والرسائل الخطأ اللاحقة
4. مراقبة الإخراج غير المتوقع في قنوات Slack/Mattermost من مصادر الوكيل