matrix-org/dendrite

Dendrite does not validate `senders` and `rooms` IDs in filters

Open

#2,067 opened on Dec 2, 2021

 (0 comments) (0 reactions) (0 assignees)Go (658 forks)auto 404
C-Client-APIF-FiltersT-Defectgood first issue

Repository metrics

Stars
 (5,632 stars)
PR merge metrics
 (PR metrics pending)

Description

Background information

  • Dendrite version or git SHA: 83b9cb4d79123ec89e18a46d5202e74a9e9305b8
  • Running in Docker?: yes

This was found while running Complement, so build information from this Dockerfile also applies.

Description

When working on matrix-org/complement@8021d43 (#259), dendrite failed the tests with the following logs;

    client.go:392: POST hs1/_matrix/client/r0/user/@alice:hs1/filter => 200 OK (84.506966ms)
    invalid_test.go:180: Expected 4XX status code, got 200 for testing filter map[room:map[timeline:map[rooms:[not_a_room_id]]]]
    client.go:392: POST hs1/_matrix/client/r0/user/@alice:hs1/filter => 200 OK (57.808076ms)
    invalid_test.go:180: Expected 4XX status code, got 200 for testing filter map[room:map[timeline:map[senders:[not_a_sender_id]]]]

This test comes from sytest, and i am pretty sure that dendrite should at least try to validate these strings to valid User IDs and Room IDs

Contributor guide