Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/hierarchy returns 403 when unknown room is accessible through federation #17143

Closed
ajbura opened this issue May 2, 2024 · 1 comment · Fixed by #17194
Closed

/hierarchy returns 403 when unknown room is accessible through federation #17143

ajbura opened this issue May 2, 2024 · 1 comment · Fixed by #17194

Comments

@ajbura
Copy link

ajbura commented May 2, 2024

Description

/hierarchy returns 403 when room is not on server without trying to get it from federation.

Steps to reproduce

  • take roomId which is not on your server
  • ask for hierarchy
  • return 403 without checking over federation(even when it is available through federation)

Homeserver

matrix.org, envs.net

Synapse Version

{"server_version":"1.106.0rc1 (b=matrix-org-hotfixes,b9639065eb)"}

Installation Method

Docker (matrixdotorg/synapse)

Database

N/A

Workers

I don't know

Platform

N/A

Configuration

N/A

Relevant log output

N/A

Anything else that would be useful to know?

problem area:

if not await self._is_local_room_accessible(requested_room_id, requester):

it should also try to _summarize_remote_room_hierarchy before raising error

@ajbura ajbura changed the title /hierarchy returns 403 when room is not on server /hierarchy returns 403 when unknown room is accessible through federation May 5, 2024
kfiven added a commit to kfiven/synapse that referenced this issue Sep 24, 2024
Trying to fix element-hq#17143 again

The change actually need via parameter in the /hierarchy endpoint in spec, but IMO temporarily its a good fix to atleast look for the server extracting from the room id rather than nothing.
@anoadragon453
Copy link
Member

https://matrix.to/#/!vcyiEtMVHIhWXcJAfl:sw1v.org/$BqX1ysEr7WQZwiZUyz2qDYNtND-LdQhlGst19ExLwks?via=matrix.org&via=element.io&via=envs.net notes that GET /_matrix/client/v1/rooms/{roomId}/hierarchy is not actually intended to be called with non-local rooms as the root room, invalidating this issue. The proper fix would indeed be to provide a via parameter to that endpoint. But doing so would be a separate MSC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants