discourse/app
Alan Guo Xiang Tan 0b84353162
SECURITY: Prevent arbitrary topic custom fields from being set
Why this change?

The `PostsController#create` action allows arbitrary topic custom fields
to be set by any user that can create a topic. Without any restrictions,
this opens us up to potential security issues where plugins may be using
topic custom fields in security sensitive areas.

What does this change do?

1. This change introduces the `register_editable_topic_custom_field` plugin
API which allows plugins to register topic custom fields that are
editable either by staff users only or all users. The registered
editable topic custom fields are stored in `DiscoursePluginRegistry` and
is called by a new method `Topic#editable_custom_fields` which is then
used in the `PostsController#create` controller action. When an unpermitted custom fields is present in the `meta_data` params,
a 400 response code is returned.

2. Removes all reference to `meta_data` on a topic as it is confusing
   since we actually mean topic custom fields instead.
2023-10-16 10:51:28 -04:00
..
assets SECURITY: Correctly escape 'text' email preview (stable) 2023-10-16 10:51:26 -04:00
controllers SECURITY: Prevent arbitrary topic custom fields from being set 2023-10-16 10:51:28 -04:00
helpers DEV: Correctly strip sourcemap URL from splash-screen js (#22879) 2023-07-31 16:49:27 +01:00
jobs FIX: Missing pending queued posts from topic view (#22838) 2023-07-28 16:16:23 +00: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: Prevent arbitrary topic custom fields from being set 2023-10-16 10:51:28 -04:00
serializers DEV: Remove unread_private_messages and deprecation (#22893) 2023-08-01 14:44:39 +10: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: Hide restricted tags in noscript view 2023-07-28 12:53:50 +01:00