Sophos SFOS SQL Injection Vulnerability — Sophos Firewall operating system (SFOS) firmware contains a SQL injection vulnerability when configured with either the administration (HTTPS) service or the User Portal is exposed on the WAN zone. Successful exploitation may cause remote code execution to exfiltrate usernames and hashed passwords for the local device admin(s), portal admins, and user accounts used for remote access (but not external Active Directory or LDAP passwords).
CVE-2020-12271 is a critical SQL injection vulnerability in Sophos Firewall Operating System (SFOS) that allows remote attackers to execute arbitrary code and exfiltrate sensitive credentials when the administration interface or User Portal is exposed to the WAN. Successful exploitation enables theft of hashed passwords for local admins, portal admins, and VPN/remote access users. This vulnerability was actively exploited in the wild by threat actors, including nation-state groups, making it a high-priority remediation target. Organizations with internet-facing Sophos firewalls are at immediate risk of perimeter compromise.
IMMEDIATE ACTIONS (0-24 hours):
1. Disable WAN-facing access to the Sophos SFOS administration interface (HTTPS) and User Portal immediately if not operationally required.
2. Restrict management access to trusted IP ranges only using firewall ACLs.
3. Audit all active administrative sessions and terminate suspicious ones.
4. Rotate ALL local admin, portal admin, and VPN/remote access user passwords immediately — assume all hashed credentials are compromised if the device was exposed.
5. Check for indicators of compromise: review SFOS logs for unusual SQL patterns, unexpected admin logins, or configuration changes.
PATCHING GUIDANCE:
1. Apply Sophos hotfix v17.5 MR3 (17.5.3) or later immediately — Sophos released an automatic hotfix for supported versions.
2. Verify hotfix application via Device Console: system diagnostic show version.
3. Upgrade to SFOS v18 or later if running end-of-life firmware versions.
4. Check Sophos advisory SA-8 (April 2020) for full version compatibility matrix.
COMPENSATING CONTROLS (if patching is delayed):
1. Implement a WAF or reverse proxy in front of the User Portal.
2. Enable geo-blocking to restrict access to Saudi Arabia and known business partner IPs only.
3. Deploy MFA for all administrative and VPN access immediately.
4. Enable enhanced logging and forward to SIEM for anomaly detection.
DETECTION RULES:
1. SIEM Rule: Alert on SQL metacharacters (', --, ;, UNION, SELECT) in SFOS web access logs.
2. IDS Signature: Detect HTTP requests to /userportal/Controller?mode= with SQL injection payloads.
3. Monitor for unexpected outbound connections from the firewall management IP.
4. Alert on new admin account creation or privilege escalation events in SFOS audit logs.
5. Hunt for Asnarök trojan indicators (associated with this CVE exploitation) in network traffic.
الإجراءات الفورية (خلال 0-24 ساعة):
1. تعطيل الوصول عبر WAN لواجهة إدارة Sophos SFOS (HTTPS) وبوابة المستخدم فوراً إذا لم يكن ذلك ضرورياً تشغيلياً.
2. تقييد وصول الإدارة على نطاقات IP موثوقة فقط باستخدام قوائم التحكم في الوصول.
3. مراجعة جميع جلسات الإدارة النشطة وإنهاء الجلسات المشبوهة.
4. تغيير جميع كلمات مرور المديرين المحليين ومديري البوابة ومستخدمي VPN فوراً — افترض أن جميع بيانات الاعتماد المجزأة قد تم اختراقها.
5. فحص مؤشرات الاختراق: مراجعة سجلات SFOS بحثاً عن أنماط SQL غير عادية أو تسجيلات دخول مشبوهة.
إرشادات التصحيح:
1. تطبيق التحديث العاجل Sophos v17.5 MR3 أو أحدث فوراً.
2. التحقق من تطبيق التحديث عبر وحدة تحكم الجهاز.
3. الترقية إلى SFOS v18 أو أحدث في حالة تشغيل إصدارات منتهية الدعم.
4. مراجعة التوجيه الأمني SA-8 من Sophos لمصفوفة توافق الإصدارات الكاملة.
ضوابط التعويض (في حالة تأخر التصحيح):
1. تنفيذ WAF أو وكيل عكسي أمام بوابة المستخدم.
2. تفعيل الحجب الجغرافي لتقييد الوصول على المملكة العربية السعودية وعناوين IP الشركاء المعروفين فقط.
3. تفعيل المصادقة متعددة العوامل لجميع الوصول الإداري و VPN فوراً.
4. تفعيل التسجيل المحسّن وإرساله إلى SIEM للكشف عن الشذوذات.
قواعد الكشف:
1. قاعدة SIEM: تنبيه على أحرف SQL الخاصة في سجلات الوصول لـ SFOS.
2. توقيع IDS: الكشف عن طلبات HTTP تحتوي على حمولات حقن SQL.
3. مراقبة الاتصالات الصادرة غير المتوقعة من IP إدارة جدار الحماية.
4. تنبيه على إنشاء حسابات مدير جديدة أو أحداث تصعيد الصلاحيات في سجلات SFOS.