SaltStack Salt Shell Injection Vulnerability — SaltStack Salt allows an unauthenticated user with network access to the Salt API to use shell injections to run code on the Salt API using the SSH client. This vulnerability affects any users running the Salt API.
CVE-2020-16846 is a critical shell injection vulnerability in SaltStack Salt that allows unauthenticated remote attackers to execute arbitrary code on systems running the Salt API via SSH client injection. With a CVSS score of 9.0 and a confirmed public exploit, this vulnerability poses an immediate and severe threat to any organization using SaltStack for infrastructure automation and configuration management. The vulnerability requires no authentication, dramatically lowering the barrier for exploitation by threat actors. Organizations must treat this as an emergency requiring immediate remediation given the widespread use of SaltStack in enterprise and cloud environments.
IMMEDIATE ACTIONS (within 24 hours):
1. Identify all systems running Salt API (salt-api service) across your environment immediately.
2. Disable or firewall the Salt API port (default 8000/TCP) from public internet access immediately.
3. Restrict Salt API access to trusted IP ranges only using firewall ACLs or security groups.
4. Check Salt API logs for signs of exploitation: look for unusual SSH subprocess spawning, unexpected outbound connections, or anomalous command execution patterns.
PATCHING GUIDANCE:
5. Upgrade SaltStack Salt to version 3001.1, 3000.3, or 2019.2.7 or later — these versions contain the official fix.
6. Follow the SaltStack security advisory (https://saltproject.io/security_announcements/) for version-specific patch instructions.
7. After patching, rotate all Salt API credentials, tokens, and any secrets accessible from Salt masters.
COMPENSATING CONTROLS (if immediate patching is not possible):
8. Completely disable the Salt API service until patching is complete: systemctl stop salt-api && systemctl disable salt-api
9. Implement network segmentation to isolate Salt masters from untrusted networks.
10. Deploy WAF rules to detect and block shell metacharacter injection patterns targeting the Salt API endpoint.
11. Enable process-level monitoring (auditd/Sysmon) to detect unexpected child processes spawned by salt-api.
DETECTION RULES:
12. SIEM alert: Monitor for salt-api spawning /bin/sh, /bin/bash, or ssh processes as child processes.
13. Network IDS: Alert on HTTP POST requests to /run or /hook endpoints containing shell metacharacters (;, |, &&, $(), backticks).
14. Threat hunt: Search for new cron jobs, SSH authorized_keys modifications, or new user accounts created after Salt API activity.
15. Review Salt master logs at /var/log/salt/api for anomalous entries.
الإجراءات الفورية (خلال 24 ساعة):
1. تحديد جميع الأنظمة التي تشغّل Salt API (خدمة salt-api) في بيئتك فوراً.
2. تعطيل أو حجب منفذ Salt API (الافتراضي 8000/TCP) من الوصول العام للإنترنت فوراً.
3. تقييد الوصول إلى Salt API على نطاقات IP موثوقة فقط باستخدام قوائم التحكم بالوصول أو مجموعات الأمان.
4. مراجعة سجلات Salt API بحثاً عن علامات الاستغلال: ابحث عن عمليات SSH غير معتادة، أو اتصالات صادرة مشبوهة، أو أنماط تنفيذ أوامر غير طبيعية.
إرشادات التصحيح:
5. ترقية SaltStack Salt إلى الإصدار 3001.1 أو 3000.3 أو 2019.2.7 أو أحدث — تحتوي هذه الإصدارات على الإصلاح الرسمي.
6. اتباع النشرة الأمنية لـ SaltStack للحصول على تعليمات التصحيح الخاصة بكل إصدار.
7. بعد التصحيح، تدوير جميع بيانات اعتماد Salt API والرموز المميزة وأي أسرار يمكن الوصول إليها من خوادم Salt الرئيسية.
ضوابط التعويض (إذا تعذّر التصحيح الفوري):
8. تعطيل خدمة Salt API بالكامل حتى اكتمال التصحيح: systemctl stop salt-api && systemctl disable salt-api
9. تطبيق تجزئة الشبكة لعزل خوادم Salt الرئيسية عن الشبكات غير الموثوقة.
10. نشر قواعد WAF للكشف عن أنماط حقن الأوامر الخاصة بنقطة نهاية Salt API وحجبها.
11. تفعيل مراقبة العمليات (auditd/Sysmon) للكشف عن العمليات الفرعية غير المتوقعة التي تنشئها salt-api.
قواعد الكشف:
12. تنبيه SIEM: مراقبة salt-api عند إنشاء عمليات /bin/sh أو /bin/bash أو ssh كعمليات فرعية.
13. IDS الشبكي: التنبيه على طلبات HTTP POST إلى نقاط النهاية /run أو /hook التي تحتوي على محارف خاصة بالأوامر.
14. البحث عن التهديدات: البحث عن مهام cron جديدة، أو تعديلات على SSH authorized_keys، أو حسابات مستخدمين جديدة أُنشئت بعد نشاط Salt API.
15. مراجعة سجلات Salt master في /var/log/salt/api بحثاً عن إدخالات غير طبيعية.