+Rate limiters such as express-rate-limit and express-slow-down count
+requests per client, using a key computed by the keyGenerator option. If the key is
+taken from a value that the client controls, such as the X-Forwarded-For or
+X-Real-IP request header, a client can send a different value with each request and
+is never limited. This allows, for example, brute-force attacks on passwords, one-time codes or
+password-reset answers.
+
+The same applies to req.ip and req.ips when the Express application
+trusts all proxies (app.enable('trust proxy') or
+app.set('trust proxy', true)), because Express then takes the client address from the
+left-most, client-supplied, entry of the X-Forwarded-For header. Note that Node.js
+lower-cases the names of request headers, so a lookup such as
+req.headers['X-Forwarded-For'] is always undefined; a key such as
+req.headers['X-Forwarded-For'] ?? req.ip therefore depends only on req.ip.
+
+Do not derive rate-limiting keys from request headers. Use req.ip and configure the
+Express trust proxy setting to trust only the proxies that are actually in front of
+the application (for example a fixed number of hops, or specific addresses). If a reverse proxy
+overwrites a client address header, make sure the application can't be reached without that
+proxy before relying on the header.
+
+In the following example, all proxies are trusted and the limiter is keyed on the raw
+X-Forwarded-For header, falling back to req.ip. Both values are chosen
+by the client, so the limit can be evaded by changing the header on every request.
+
+In the following example, only the single reverse proxy in front of the application is trusted,
+so req.ip is the address of the client as seen by that proxy.
+
+Reusing a session could allow an attacker to gain unauthorized access to another account. +Always ensure that, when a user logs in or out, the current session is abandoned so that a new +session may be started. +
++This query also recognizes login handlers that pass the session object to a helper function, +which then marks the session as authenticated without regenerating it. +
+
+Always use req.session.regenerate(...); to start a new session when a user logs in or out.
+
+The following example passes the existing session to a helper that stores the authenticated user +in it. An attacker who planted or learned the session ID before the user logged in can use it to +access the user's account afterwards. +
+
+The following example solves the problem by calling req.session.regenerate() before
+storing the authenticated user, so that the previous session is not reused.
+