Limit the number of subscription filters per subscriber

A subscriber could keep sending subscribe requests with new filters and
the controller would add every one of them to the subscriber's filter
set without bound, growing memory until it ran out.

Add controller.max_subscription_filters (default 10000) and reject
subscribe and replace requests that would leave a subscriber holding
more filters than that for one event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-08 11:10:03 +00:00
1 parent ce6bfe282f
commit 690b79d2b7
5 files changed
+95 -5

No files matched your search

+1 -1
View File
@@ -83,7 +83,7 @@ export default class Controller {
private _events = new events.EventEmitter<ControllerEvents>();
/** Event subscription controller */
subscriptions = new lib.SubscriptionController();
subscriptions = new lib.SubscriptionController(() => this.config.get("controller.max_subscription_filters"));
/** User manager for the cluster, also contains access to the user records */
users: UserManager;
/** Instance manager for the cluster, also contains access to the user records */