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

Sending array instead of object for "ignored_users" breaks synapse for one user #8357

Closed
krille-chan opened this issue Sep 20, 2020 · 0 comments · Fixed by #8454
Closed

Sending array instead of object for "ignored_users" breaks synapse for one user #8357

krille-chan opened this issue Sep 20, 2020 · 0 comments · Fixed by #8454
Assignees
Labels
A-Validation 500 (mostly) errors due to lack of event/parameter validation z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@krille-chan
Copy link

Description

I have played around with FluffyChat to implement ignored user lists and have sent a wrong account data event to Synapse. This makes Synapse unusable for my user.

The broken event:

{
    "content": {
        "ignored_users": [
            "@test:janian.de"
        ]
    },
    "type": "m.ignored_user_list"
}

I have just missunderstood the spec and have sent an array and not an object as "ignored_users".

Logs:

2020-09-20 07:53:32,780 - synapse.http.server - 80 - ERROR - GET-8896 - Failed handle request via 'SyncRestServlet': <XForwardedForRequest at 0xffff882be940 method='GET' uri='/_matrix/client/r0/sync?fil>
Traceback (most recent call last):
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/synapse/http/server.py", line 229, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/synapse/http/server.py", line 406, in _async_render
    callback_return = await raw_callback_return
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/synapse/rest/client/v2_alpha/sync.py", line 174, in on_GET
    sync_result = await self.sync_handler.wait_for_sync_for_user(
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/synapse/handlers/sync.py", line 278, in wait_for_sync_for_user
    res = await self.response_cache.wrap(
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/synapse/handlers/sync.py", line 310, in _wait_for_sync_for_user
    result = await self.current_sync_for_user(
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/synapse/handlers/sync.py", line 342, in current_sync_for_user
    return await self.generate_sync_result(sync_config, since_token, full_state)
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/synapse/handlers/sync.py", line 998, in generate_sync_result
    res = await self._generate_sync_entry_for_rooms(
  File "/home/ubuntu/synapse/env/lib/python3.8/site-packages/synapse/handlers/sync.py", line 1395, in _generate_sync_entry_for_rooms
    ignored_users = ignored_account_data.get("ignored_users", {}).keys()
AttributeError: 'list' object has no attribute 'keys'

Version information

  • Homeserver: janian.de
  • Version:
    {
    "python_version": "3.8.2",
    "server_version": "1.19.3"
    }

  • Install method:
    pip

  • Platform:
    Ubuntu 20.04 on Raspberry Pi 4B

@krille-chan krille-chan changed the title Sending array instead of object for "ignored_users" breaks synapse Sending array instead of object for "ignored_users" breaks synapse for one user Sep 20, 2020
@clokep clokep added A-Validation 500 (mostly) errors due to lack of event/parameter validation z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Sep 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Validation 500 (mostly) errors due to lack of event/parameter validation z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants