-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Summary
It seems there is some rate limiting on the Strapi login page by default. But I am unable to find information about it in the documentation.
I have looked here and even in the v4 version of the page.
Would it be possible to document it in users-permissions.md?
On the soon to be closed forum, I have found this message giving an example of configuration for Strapi v4, no idea if that does still apply for Strapi v5, and what are the units of the settings, to which endpoints it applies, ...
// path: ./config/plugins.js
module.exports = ({ env }) => ({
'users-permissions': {
config: {
ratelimit: {
interval: 60000,
max: 100000
}
}
}
});
Obviously this sample code seems to practically disable the rate limiting, though.
I have also found this CVE which implies there is actually a rate limiting in Strapi v4 at least on the login endpoint.
Why is it needed?
Some of our users have complained about 429 errors when attempting to login, and we had no clue about the cause.
We also have no mean to asses if we need to act on the rate limiting rule parameters, having no idea what they are. Is it IP based, so causing troubles when multiple users share the same IP? Something else? What is the default trigger? Time period considered, how many attempt triggers the blocking, ...?
We thought it was our own CloudFlare rules, but no event were to be seen there. And so, we have configured redundant rate limiting rules if Strapi already have its own, by lack of knowing it.
Suggested solution(s)
Document default rate limiting rules in place in Strapi:
- Which endpoints/features are rate limited by default?
- Which identifiers are used for consolidating the requests count?
- Which time period?
- Which max-count limit triggers the blocking?
- How can all of this be configured?
Related issue(s)/PR(s)
#226 seems to imply this feature was documented in Strapi v3.