Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4bb203e

Browse files
Fix missing null character check on guest_access room state (#8373)
When updating the `room_stats_state` table, we try to check for null bytes slipping in to the content for state events. It turns out we had added `guest_access` as a field to room_stats_state without including it in the null byte check. Lo and behold, a null byte in a `m.room.guest_access` event then breaks `room_stats_state` updates. This PR adds the check for `guest_access`.
2 parents bbde403 + 48336ee commit 4bb203e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

changelog.d/8373.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Include `guest_access` in the fields that are checked for null bytes when updating `room_stats_state`. Broke in v1.7.2.

synapse/storage/databases/main/stats.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ async def update_room_state(self, room_id: str, fields: Dict[str, Any]) -> None:
210210
* topic
211211
* avatar
212212
* canonical_alias
213+
* guest_access
213214
214215
A is_federatable key can also be included with a boolean value.
215216
@@ -234,6 +235,7 @@ async def update_room_state(self, room_id: str, fields: Dict[str, Any]) -> None:
234235
"topic",
235236
"avatar",
236237
"canonical_alias",
238+
"guest_access",
237239
):
238240
field = fields.get(col, sentinel)
239241
if field is not sentinel and (not isinstance(field, str) or "\0" in field):

0 commit comments

Comments
 (0)