المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : ووردبريس WordPress حل مشكلة تسجيل الدخول Social login وظهور Server Error بسبب ModSec



Rise Company
13-04-2023, 13:01
ووردبريس WordPress حل مشكلة تسجيل الدخول Social login وظهور Server Error بسبب ModSec
​Access denied - mod security blocking google
cpanel modsecurity google login Server Error
google login 500 internal server
Mod_Security blocking WordPress logins
Issues with modsecurity OWASP and false positives.
Access denied with code 403 (phase 2).

المشكلة :

عند تفعيل اضافة تسجيل الدخول عبر جوجل او الفييسبوك, يعمل فيسبوك دون مشاكل
لكن جوجل يظهر server error وهذه سببه Modsecurity
يعمل block لبعض الكلمات او الاكواد او plugins التى بها ثغرات امنية
وهى التى يستخدمها الهكر فى ملفات php للاختراق
وهام جدا عدم تعطيل Modsecurity فهى Web Application Firewall
واذا كنت مضطر لتعطيلها يجب تثبيت بديل
مثلا : Wordfence Security Plugin


حل المشكلة :

حل سريع لا ننصح به وهو بتعطيل Modsecurity
وهو طبقة حماية اضافية تحمى الموقع من كلمات محددة يكتبها الهكر لاختراق الموقع
وتعمل block على الفور, عطلها لتتاكد من حل المشكلة ثم رجعها مرة اخري

https://www.rise.company/upload/uploads/168138356293511.png

https://www.rise.company/upload/uploads/168138350885671.png

اذا لم تجده فى cpanel من خلال whm ثم Feature Manager
وفعل ModSecurity™ Domain Manager

---------------------------------------

لحل المشكلة بشكل صحيح وامن !

يجب التواصل مع صاحب Plugin او Template لاخذ من التعليمات
او تعديل الكود الخاص به ليجعله متوافق مع Modsecurity

او عطل Rule المسبب لذلك

in WHM under plugins, you should have 'mod security', go to that, and there is an 'edit config' button, press that, make your changes, save it, then restart apache

ثم ابحث عن profile او id او name مكتوب فى error المسبب للمشكلة وقم بتعطيله

hey're good rules but generally there are at least 5-10 you need to disable for most modern CMS software to work; which ones you need to disable will vary based on the software you use for your site(s).
It's important to note the ModSecurity itself only blocks requests, not IP addresses, but if you use CSF then LFD will block your IP for repeat modsecurity entries in the logs from your IP tripping rules.

المشكلة انه ليس rule واحد فقط فى الغالب قد يصل الى 5 هيتم تعطيلهم

لمعرف اسم profile او Rule المسبب ؟

اذهب الى Home / Security Center / ModSecurity™ Tools » Hits List

ابحث ctr+f عن كلمة google

https://www.rise.company/upload/uploads/168138596411912.png

ثم هتجد فى عمود Rule ID فى كل سطر يبدا برقم هذا هو المسبب للمشكلة
وهذه rules هى 949110 / 930120 / 980130

سجل هذه الارقام لكى نقوم بعد ذلك بتعطيلها من Rules List

كيف تقوم بتعطيل Rule ؟

ادخل على Rules List ثم ابحث برقم Rule ID ثم Edit Rule ثم على اليمين Disable

https://www.rise.company/upload/uploads/16813859639851.png

طبق هذا على كل rule يسبب هذا المشكلة
وننصح بالتواصل مع مبرمج social login لكى تصحح هذه المشكلة من جانبه
او تقديم النصيحة فى كيفيه حل هذه المشكلة بشكل امن.


المرجع:
https://forums.cpanel.net/threads/mod-security-blocking-google.99309/
https://forums.cpanel.net/threads/mod_security-blocking-wordpress-logins.631087/
https://forums.cpanel.net/threads/mod-security-and-google.318842/
https://forums.cpanel.net/threads/owasp-mod-security-and-wordpress.452091/
https://documentation.cpanel.net/display/CKB/OWASP+ModSecurity+CRS?_ga=2.123648779.1078266401.1 681382973-1792525322.1662857201

Rise Company
13-04-2023, 13:41
يمكنك ايضا الاستعانة باللوج من خلال csf


/usr/local/apache/logs/modsec_audit.log

او من داخل cpanel فى Errors