dendrite icon indicating copy to clipboard operation
dendrite copied to clipboard

Creating a room by inviting a user may need some sanitation checks for their address before writing to database

Open jittygitty opened this issue 3 years ago • 1 comments

Background information

  • For version info etc, please see my other ticket from minutes ago:
  • https://github.com/matrix-org/dendrite/issues/2499

Description

I noticed errors in dendrite complaining about "port" of ":org"

Steps to reproduce

I haven't tried to reproduce, but from what I recall, I remember typing in a user to invite to a (DM? i think), typing the domain wrong like: @theuser:matrix:org Basically instead of a "." i mistakenly typed a colon. It didn't work and after i realized and redid with correct info. But apparently the ":" still stuck around the database. I think I ended up manually replacing : with . in the key... and rooms db files. (I made it @theuser:www.matrix.org because @theuser:matrix.org already existed also...) Anyway that resolved all those port ":org" errors... But I'm guessing they can be avoided in future with small patch.

jittygitty avatar May 28 '22 03:05 jittygitty

But perhaps address sanitation checks are even better to have first on client side, why waste going to server and then back again to client to complain to user when the client can quickly validate address to make sure that if it ends in colon and some characters it gives error since should only be port/numbers after "second" use of colon.

jittygitty avatar May 29 '22 19:05 jittygitty