discourse/app
Alan Guo Xiang Tan bfc3132bb2
SECURITY: Impose a upper bound on limit params in various controllers
What is the problem here?

In multiple controllers, we are accepting a `limit` params but do not
impose any upper bound on the values being accepted. Without an upper
bound, we may be allowing arbituary users from generating DB queries
which may end up exhausing the resources on the server.

What is the fix here?

A new `fetch_limit_from_params` helper method is introduced in
`ApplicationController` that can be used by controller actions to safely
get the limit from the params as a default limit and maximum limit has
to be set. When an invalid limit params is encountered, the server will
respond with the 400 response code.
2023-07-28 12:53:46 +01:00
..
assets Revert "DEV: Skip flaky QUnit tests (#22847)" (#22850) 2023-07-28 17:37:31 +08:00
controllers SECURITY: Impose a upper bound on limit params in various controllers 2023-07-28 12:53:46 +01:00
helpers SECURITY: Don't reuse CSP nonce between anonymous requests 2023-07-28 12:53:44 +01:00
jobs DEV: Replace raw comments with deprecation warnings (#22617) 2023-07-18 10:13:40 +08:00
mailers FIX: Order tags shown in email subject by topics count and name (#22586) 2023-07-13 15:39:58 +08:00
models SECURITY: Impose a upper bound on limit params in various controllers 2023-07-28 12:53:46 +01:00
serializers FIX: Seed all categories and tags configured as defaults for nav menu (#22793) 2023-07-27 10:52:33 +08:00
services FIX: Seed all categories and tags configured as defaults for nav menu (#22793) 2023-07-27 10:52:33 +08:00
views SECURITY: Don't reuse CSP nonce between anonymous requests 2023-07-28 12:53:44 +01:00