mirror of
https://github.com/element-hq/synapse.git
synced 2026-05-12 13:04:47 +00:00
Limit the size of the aggregation_key (#12101)
There's no reason to let people use long keys.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Limit the size of `aggregation_key` on annotations.
|
||||
@@ -1069,6 +1069,9 @@ class EventCreationHandler:
|
||||
if relation_type == RelationTypes.ANNOTATION:
|
||||
aggregation_key = relation["key"]
|
||||
|
||||
if len(aggregation_key) > 500:
|
||||
raise SynapseError(400, "Aggregation key is too long")
|
||||
|
||||
already_exists = await self.store.has_user_annotated_event(
|
||||
relates_to, event.type, aggregation_key, event.sender
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user