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

/_synapse/admin/v1/users/<uid>/admin Fails if user id is URL encoded #6752

Closed
NHAS opened this issue Jan 20, 2020 · 1 comment
Closed

/_synapse/admin/v1/users/<uid>/admin Fails if user id is URL encoded #6752

NHAS opened this issue Jan 20, 2020 · 1 comment
Assignees

Comments

@NHAS
Copy link

NHAS commented Jan 20, 2020

Description

GET /_synapse/admin/v1/users/<user_id>/admin doesnt allow for URL encoded user_ids, as such this disable some UI functionality in riot.im, which is where I first noticed it. As it was giving a 400 error.

Steps to reproduce

  1. Get valid admin token
  2. GET /_synapse/admin/v1/users/%40admin%3amatrix.server/admin
  3. View response as error

What should happen is url encoding is causing the regex not to match. Caused by a regex on line:

PATTERNS = (re.compile("^/_synapse/admin/v1/users/(?P<user_id>@[^/]*)/admin$"),)

That should be:
PATTERNS = (re.compile("^/_synapse/admin/v1/users/(?P<user_id>[^/]*)/admin$"),)

Which removes the "@" symbol requirement.

Version information

  • Homeserver: personal private homeserver, not matrix.org

If not matrix.org:

  • Version: {"server_version": "1.8.0", "python_version": "3.6.9"}

  • Install method: Apt package manager, after importing keys as per install instruction

  • Platform: Ubuntu 18.04, running within a VM, Nginx reverse proxy

Although this is behind the NGINX reverse proxy, I have also tested this via localhost:8008 and it still presents the problem.

@anoadragon453
Copy link
Member

Fixed in, #6825. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants