element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.24k stars 2k forks source link

GET well-known file. Incorrect DNS address when server name and domain name are different. #28117

Closed H3lpD3sk-H3r0 closed 1 month ago

H3lpD3sk-H3r0 commented 1 month ago

Steps to reproduce

  1. Launch the Element WEB application at https://develop.element.io/
  2. Log in to a user account on matrixsynapse.ddns.net.
  3. Open the development tools in the browser.
  4. Find in the console the step of requesting well-known from homeserver.

Screenshot: error_from_element_web

Outcome

What did you expect?

The file will be requested at the server address: https://matrixsynapse.ddns.net/.well-known/matrix/client.

What happened instead?

The file was requested by the server name https://tyga-matrix/.well-known/matrix/client

How can I get around it?

Option 1: Spoof the GET request using Carles Proxy. Option 2. Overrite the init.js file using a browser debuger. Change the logic of the getDomain() function in the file. But this does not solve the root cause.

Operating system

Windows 10

Browser information

MS Edge 129.0.2792.65 (x64)

URL for webapp

develop.element.io

Application version

Element version: 1b31e7f67b28-react-8962e8cdd3f6-js-baa6d1350656 Crypto version: Rust SDK 0.7.2 (7a21514), Vodozemac 0.7.0

Homeserver

Synapse 1.115.0

Will you send logs?

Yes

t3chguy commented 1 month ago

The file was requested by the server name tyga-matrix/.well-known/matrix/client

This is as per the spec, the well-known is hosted on the server_name not the URL. https://spec.matrix.org/v1.11/client-server-api/#well-known-uri