Strapi is an open source headless content management system. In Strapi versions prior to 5.45.0, the rate-limit middleware in the users-permissions plugin derived its rate-limit key in part from `ctx.request.body.email`, including on routes whose body schema does not contain an `email` field (`/auth/local`, `/auth/reset-password`, `/auth/change-password`). An unauthenticated attacker could include an arbitrary `email` value in the request body to obtain a fresh rate-limit key per request, effectively bypassing per-IP throttling on those routes and enabling high-volume credential brute-force, password-reset code brute-force, and credential-stuffing attempts. The rate-limit key was constructed as `${userIdentifier}:${requestPath}:${ctx.request.ip}`, where `userIdentifier = ctx.request.body.email`. On routes that legitimately use email as their identifier (e.g. `/auth/forgot-password`, `/auth/local/register`), this scoping is correct. On routes that use a different identifier (`identifier` for login, `code` for password reset, `currentPassword` for password change), the email field was not part of the route contract, but the middleware still incorporated it into the key, allowing a caller to rotate the value and obtain a unique key on every request. The patch in version 5.45.0 maintains an allow-list of routes that legitimately key on the email field and excludes that key component on every other route the middleware is mounted on. OAuth callback paths (`/connect/*`) are treated identifier-less. On routes outside the allow-list, the middleware now falls back to a fixed identifier-less key, ensuring per-IP throttling remains effective even when the request body is attacker-controlled.
Strapi versions prior to 5.45.0 contain a rate-limit bypass vulnerability in the users-permissions plugin that allows unauthenticated attackers to circumvent per-IP throttling on authentication routes by manipulating the email field in request bodies. This enables high-volume brute-force attacks against login, password reset, and password change endpoints. The vulnerability affects organizations using Strapi as their headless CMS, particularly those exposing authentication endpoints to the internet without additional rate-limiting controls.
Immediate Actions:
1. Identify all Strapi instances in your environment and determine their version (check package.json or admin panel)
2. If running Strapi < 5.45.0, immediately upgrade to version 5.45.0 or later
3. Review authentication logs for suspicious patterns: multiple failed login attempts from different IPs with varying email values, rapid password reset requests, or unusual password change attempts
Patching Guidance:
1. Test the upgrade in a non-production environment first
2. Back up your Strapi database and configuration before upgrading
3. Run npm update or yarn upgrade to pull version 5.45.0+
4. Restart Strapi services after upgrade
5. Verify rate-limiting is functioning by testing authentication endpoints
Compensating Controls (if immediate patching is delayed):
1. Implement WAF rules to detect and block requests with rapidly changing email values to /auth/* endpoints
2. Deploy reverse proxy rate-limiting at the infrastructure level (nginx, HAProxy) with per-IP limits on /auth/local, /auth/reset-password, /auth/change-password
3. Implement CAPTCHA on authentication forms to prevent automated attacks
4. Monitor for brute-force patterns: alert on >5 failed login attempts per IP per minute
5. Enable account lockout after 5 failed login attempts for 15 minutes
Detection Rules:
1. Alert on requests to /auth/local, /auth/reset-password, /auth/change-password with email field values that change on every request from the same source IP
2. Monitor for >10 requests per second to authentication endpoints from single IP
3. Flag password reset requests with >3 different email values from same IP within 5 minutes
4. Detect credential stuffing patterns: multiple failed logins followed by successful login with different credentials
الإجراءات الفورية:
1. حدد جميع مثيلات Strapi في بيئتك وحدد إصدارها (تحقق من package.json أو لوحة المسؤول)
2. إذا كنت تقوم بتشغيل Strapi < 5.45.0، قم بالترقية فوراً إلى الإصدار 5.45.0 أو أحدث
3. راجع سجلات المصادقة للبحث عن أنماط مريبة: محاولات تسجيل دخول فاشلة متعددة من عناوين IP مختلفة بقيم بريد إلكتروني متغيرة
إرشادات التصحيح:
1. اختبر الترقية في بيئة غير إنتاجية أولاً
2. قم بعمل نسخة احتياطية من قاعدة بيانات Strapi والإعدادات قبل الترقية
3. قم بتشغيل npm update أو yarn upgrade لسحب الإصدار 5.45.0+
4. أعد تشغيل خدمات Strapi بعد الترقية
5. تحقق من أن تحديد المعدل يعمل بشكل صحيح عن طريق اختبار نقاط نهاية المصادقة
عناصر التحكم البديلة (إذا تأخر التصحيح الفوري):
1. تنفيذ قواعد WAF للكشف عن الطلبات ذات قيم البريد الإلكتروني المتغيرة بسرعة إلى نقاط نهاية /auth/* وحظرها
2. نشر تحديد معدل وكيل عكسي على مستوى البنية الأساسية (nginx، HAProxy) مع حدود لكل IP
3. تنفيذ CAPTCHA على نماذج المصادقة
4. مراقبة أنماط القوة الغاشمة: تنبيه عند >5 محاولات تسجيل دخول فاشلة لكل IP في الدقيقة
5. تفعيل قفل الحساب بعد 5 محاولات تسجيل دخول فاشلة لمدة 15 دقيقة
قواعد الكشف:
1. تنبيه على الطلبات إلى /auth/local و /auth/reset-password و /auth/change-password بقيم حقل البريد الإلكتروني التي تتغير في كل طلب من نفس IP المصدر
2. مراقبة >10 طلبات في الثانية إلى نقاط نهاية المصادقة من IP واحد
3. وضع علامة على طلبات إعادة تعيين كلمة المرور بـ >3 قيم بريد إلكتروني مختلفة من نفس IP خلال 5 دقائق
4. الكشف عن أنماط حشو بيانات الاعتماد: محاولات تسجيل دخول متعددة فاشلة متبوعة بتسجيل دخول ناجح