The Github Shortcode plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'repo' shortcode attribute in the 'github' shortcode in all versions up to, and including, 0.1 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 Github Shortcode WordPress plugin contains a Stored Cross-Site Scripting (XSS) vulnerability in the 'repo' shortcode attribute affecting all versions up to 0.1. Authenticated attackers with Contributor-level access can inject malicious scripts that execute for all page visitors. While currently unpatched, the medium CVSS score (6.4) and requirement for authenticated access limit immediate risk, though the stored nature of the vulnerability poses persistent threats to Saudi organizations using WordPress.
Immediate Actions:
1. Audit all WordPress installations using Github Shortcode plugin and identify affected versions (up to 0.1)
2. Review user access logs for Contributor-level and above accounts to detect suspicious activity
3. Scan published pages/posts for suspicious 'repo' shortcode attributes containing script tags or encoded payloads
4. Disable the Github Shortcode plugin immediately if not actively used
Compensating Controls (until patch available):
5. Restrict Contributor-level access to only trusted personnel; audit and remove unnecessary accounts
6. Implement Web Application Firewall (WAF) rules to detect and block XSS patterns in shortcode attributes
7. Enable WordPress security plugins (Wordfence, Sucuri) with XSS detection capabilities
8. Implement Content Security Policy (CSP) headers to restrict inline script execution
9. Use WordPress user role restrictions to limit who can create/edit posts with shortcodes
Detection Rules:
- Monitor for shortcode patterns: [github repo=".*<script.*"|.*javascript:|.*onerror=.*]
- Alert on post/page modifications by Contributor+ accounts
- Log all shortcode attribute values for forensic analysis
- Monitor for unusual external script loading from injected content
الإجراءات الفورية:
1. تدقيق جميع تثبيتات WordPress التي تستخدم مكون Github Shortcode وتحديد الإصدارات المتأثرة (حتى 0.1)
2. مراجعة سجلات وصول المستخدمين لحسابات مستوى المساهم وما فوقه للكشف عن النشاط المريب
3. فحص الصفحات/المنشورات المنشورة عن خصائص 'repo' shortcode المريبة التي تحتوي على علامات البرامج النصية أو الحمولات المشفرة
4. تعطيل مكون Github Shortcode فوراً إذا لم يكن قيد الاستخدام النشط
الضوابط البديلة (حتى توفر التصحيح):
5. تقييد وصول مستوى المساهم فقط للموظفين الموثوقين؛ تدقيق وإزالة الحسابات غير الضرورية
6. تنفيذ قواعد جدار الحماية (WAF) للكشف عن أنماط XSS وحجبها في خصائص shortcode
7. تفعيل مكونات أمان WordPress (Wordfence, Sucuri) مع قدرات الكشف عن XSS
8. تنفيذ رؤوس Content Security Policy (CSP) لتقييد تنفيذ البرامج النصية المضمنة
9. استخدام قيود دور المستخدم في WordPress لتحديد من يمكنه إنشاء/تحرير المنشورات باستخدام shortcodes
قواعد الكشف:
- مراقبة أنماط shortcode: [github repo=".*<script.*"|.*javascript:|.*onerror=.*]
- تنبيهات على تعديلات المنشورات/الصفحات بواسطة حسابات Contributor+
- تسجيل جميع قيم خصائص shortcode للتحليل الجنائي
- مراقبة تحميل البرامج النصية الخارجية غير العادية من المحتوى المحقون