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

/createRoom: "ValueError: invalid hostname:" when sending empty/invalid 3pid invite #13511

Open
MTRNord opened this issue Aug 11, 2022 · 0 comments
Labels
A-Create-Room A-Validation 500 (mostly) errors due to lack of event/parameter validation O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@MTRNord
Copy link
Contributor

MTRNord commented Aug 11, 2022

Description

When sending:

{"name":"a","invite_3pid":[{"address":"","id_access_token":"","id_server":"","medium":""}]}

to /_matrix/client/v3/createRoom the server returns an internal server (see log below)

Steps to reproduce

  • Create a room and set the 3pid invite to an address of an empty string. You get:
{
    "errcode": "M_UNKNOWN",
    "error": "Internal server error"
}

Homeserver

localhost

Synapse Version

{"server_version":"1.64.0","python_version":"3.9.13"}

Installation Method

Docker (matrixdotorg/synapse)

Platform

Kubernetes with postgres and the official docker image

Relevant log output

2022-08-11 22:26:00,473 - synapse.http.client - 455 - INFO - POST-4392- Error sending request to  GET https:///_matrix/identity/v2/hash_details?access_token=<redacted>: ValueError invalid hostname:
2022-08-11 22:26:00,475 - synapse.handlers.identity - 632 - WARNING - POST-4392- Error when looking up hashing details: invalid hostname:
2022-08-11 22:26:00,481 - synapse.http.client - 455 - INFO - POST-4392- Error sending request to  POST https:///_matrix/identity/api/v1/store-invite: ValueError invalid hostname:
2022-08-11 22:26:00,481 - synapse.http.server - 183 - ERROR - POST-4392- Failed handle request via 'RoomCreateRestServlet': <XForwardedForRequest at 0x7f28b048aa30 method='POST' uri='/_matrix/client/v3/createRoom' clientproto='HTTP/1.1' site='8008'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 366, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 572, in _async_render
    callback_return = await raw_callback_return
  File "/usr/local/lib/python3.9/site-packages/synapse/rest/client/room.py", line 91, in on_POST
    info, _ = await self._room_creation_handler.create_room(
  File "/usr/local/lib/python3.9/site-packages/synapse/handlers/room.py", line 990, in create_room
    ) = await self.hs.get_room_member_handler().do_3pid_invite(
  File "/usr/local/lib/python3.9/site-packages/synapse/handlers/room_member.py", line 1469, in do_3pid_invite
    event, stream_id = await self._make_and_store_3pid_invite(
  File "/usr/local/lib/python3.9/site-packages/synapse/handlers/room_member.py", line 1553, in _make_and_store_3pid_invite
    ) = await self.identity_handler.ask_id_server_for_third_party_invite(
  File "/usr/local/lib/python3.9/site-packages/synapse/handlers/identity.py", line 882, in ask_id_server_for_third_party_invite
    data = await self.blacklisting_http_client.post_json_get_json(
  File "/usr/local/lib/python3.9/site-packages/synapse/http/client.py", line 551, in post_json_get_json
    response = await self.request(
  File "/usr/local/lib/python3.9/site-packages/synapse/http/client.py", line 443, in request
    response = await make_deferred_yieldable(request_deferred)
ValueError: invalid hostname:

Anything else that would be useful to know?

No response

@DMRobertson DMRobertson added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches labels Aug 11, 2022
@richvdh richvdh added the A-Validation 500 (mostly) errors due to lack of event/parameter validation label Aug 12, 2022
@DMRobertson DMRobertson added O-Uncommon Most users are unlikely to come across this or unexpected workflow O-Occasional Affects or can be seen by some users regularly or most users rarely A-Validation 500 (mostly) errors due to lack of event/parameter validation and removed P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches O-Uncommon Most users are unlikely to come across this or unexpected workflow O-Occasional Affects or can be seen by some users regularly or most users rarely A-Validation 500 (mostly) errors due to lack of event/parameter validation labels Aug 24, 2022
@DMRobertson DMRobertson changed the title "ValueError: invalid hostname:" when sending empty/invalid 3pid invite /createRoom: "ValueError: invalid hostname:" when sending empty/invalid 3pid invite Oct 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Create-Room A-Validation 500 (mostly) errors due to lack of event/parameter validation O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

3 participants