The My Email Shortcode plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'subject' shortcode attribute in the 'my-email' shortcode in all versions up to, and including, 0.91 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
The My Email Shortcode WordPress plugin contains a Stored Cross-Site Scripting (XSS) vulnerability in the 'subject' attribute of the 'my-email' shortcode. Authenticated users with Contributor-level access can inject malicious scripts that execute for all page visitors. While no patch is currently available and exploit code is not public, this vulnerability poses a moderate risk to WordPress installations used by Saudi organizations for content management and customer communication.
Immediate Actions:
1. Audit all pages and posts using the 'my-email' shortcode for suspicious content in the 'subject' attribute
2. Review user access logs to identify any unauthorized modifications by Contributor-level accounts
3. Disable the My Email Shortcode plugin immediately if not actively used
4. Restrict Contributor-level permissions to trusted staff only; consider reducing permissions to Editor-only access
Compensating Controls:
1. Implement Web Application Firewall (WAF) rules to detect and block XSS payloads in shortcode attributes
2. Enable WordPress security plugins (e.g., Wordfence, Sucuri) with XSS detection capabilities
3. Implement Content Security Policy (CSP) headers to prevent inline script execution
4. Use WordPress hooks to sanitize and escape all shortcode output: add_filter('do_shortcode_tag', 'sanitize_shortcode_output')
5. Enable WordPress audit logging to track shortcode modifications
Detection Rules:
1. Monitor for shortcode modifications containing script tags, event handlers (onclick, onerror), or JavaScript protocols
2. Alert on any changes to pages/posts containing 'my-email' shortcode
3. Search database for patterns: [my-email subject=.*<script, [my-email subject=.*javascript:, [my-email subject=.*on[a-z]+="
Long-term:
1. Monitor plugin repository for security updates or alternative plugins
2. Consider migrating to alternative email contact solutions with better security practices
3. Implement regular security audits of WordPress plugins and themes
الإجراءات الفورية:
1. تدقيق جميع الصفحات والمنشورات التي تستخدم اختصار 'my-email' للبحث عن محتوى مريب في خاصية 'subject'
2. مراجعة سجلات الوصول للمستخدمين لتحديد أي تعديلات غير مصرح بها من حسابات المساهمين
3. تعطيل مكون My Email Shortcode فوراً إذا لم يكن قيد الاستخدام النشط
4. تقييد صلاحيات المساهمين للموظفين الموثوقين فقط؛ فكر في تقليل الصلاحيات إلى مستوى المحرر فقط
الضوابط التعويضية:
1. تنفيذ قواعد جدار الحماية لتطبيقات الويب (WAF) للكشف عن حمولات XSS وحجبها
2. تفعيل مكونات أمان WordPress (مثل Wordfence و Sucuri) مع قدرات كشف XSS
3. تنفيذ رؤوس Content Security Policy (CSP) لمنع تنفيذ البرامج النصية المضمنة
4. استخدام خطافات WordPress لتنظيف وهروب جميع مخرجات الاختصار
5. تفعيل تسجيل تدقيق WordPress لتتبع تعديلات الاختصار
قواعد الكشف:
1. مراقبة تعديلات الاختصار التي تحتوي على علامات script أو معالجات الأحداث
2. التنبيه على أي تغييرات في الصفحات التي تحتوي على اختصار 'my-email'
3. البحث في قاعدة البيانات عن أنماط XSS المعروفة
المدى الطويل:
1. مراقبة مستودع المكونات للتحديثات الأمنية أو المكونات البديلة
2. النظر في الهجرة إلى حلول بريد إلكتروني بديلة بممارسات أمان أفضل
3. تنفيذ عمليات تدقيق أمان منتظمة لمكونات وسمات WordPress