element-hq / element-hq/element-android

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

Open
#8,668 0 comments 0 reactions 0 assignees View on GitHub
O-Uncommon S-Critical T-Defect
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

### 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 - SynapseError: 400 - Query parameter 'server_name' must be ascii
10. 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.