element-hq / element-android

A Matrix collaboration client for Android.

Home Page:https://element.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If matrix homeserver has a IDN domain name admin can generate rooms via the app but nobody can join them

MattiJarvinen opened this issue · comments

Steps to reproduce

  1. homeserver server_name is a IDN -domain name configured in ACE encoding form.
  2. As a user with admin rights creates new space and add some rooms to it
  3. Invite a person to the space
  4. Person joins the space
  5. Person sees the room suggestions
  6. Person taps join on a room
  7. Client sends join room
  8. Server logs:
    2023-10-19 21:59:01,725 - synapse.http.server - 124 - INFO - POST-978 - <XForwardedForRequest at 0x54654544454
    method='POST' uri='/_matrix/client/r0/join/!{something}:{ACE ENCODED server_name}?server_name={UN ACE-ENCODED server_name URLENCODED}' clientproto='HTTP/1.1' site='8008'> SynapseError: 400 - Query parameter 'server_name' must be ascii
  9. Joining the room fails

If the domain would have been matrix.pöö.info ( an internationalized domain name ) and server_name in synapse config matrix.xn--ndaa.info ( IDN ASCII safe ACE-encoded form )
In the Room join API call server_name parameter should have been matrix.xn--ndaa.info ( server_name config as is )
Instead server_name parameter was matrix.p%C3%B6%C3%B6.info ( urlencode(matrix.pöö.info) )

Outcome

What did you expect?

Android Client doesn't mess the server_name and would use the server_name as is in the join room API call.
Joining the room succeeds.

What happened instead?

Prior to calling room API server_name is un ACE encoded into non ASCII character string.
Non ASCII string is passed to the API call
API URL-encodes the non ASCII string
Server logs the error
Joining the room fails.

Your phone model

No response

Operating system version

No response

Application version and app store

Element 1.6.6 [40106062] (G-4fa634a2)

Homeserver

Synapse 1.94.0

Will you send logs?

No

Are you willing to provide a PR?

No