Thelounge: Verify that the given nick doesn't contain invalid characters

Created on 13 Sep 2016  路  5Comments  路  Source: thelounge/thelounge

Feature

Most helpful comment

Officially I think that would be RFC 2812 section 1.2.1 that I don't understand, but having been on IRC for soon 10 years I think it would be better to give up.

Nicks may not begin with number. However nick collision nicks begin with numbers and that breaks clients that strictly follow the RFC (e.g. Supybot with strictrfc enabled is unable to do anything against a collision nick).

Some networks also accept 0 as a valid nickname changing your nick to your UID (what I above called collision nick), mainly IRCnet and anything running UnrealIRCd/InspIRCd (I don't remember which).

And if this wasn't enough, some IRC networks allow UTF-8 nicknames that I guess will allow almost anything as a nickname.

If blocking invalid characters is desirable, I would ask IRCv3 for a list of what are those invalid characters without breaking anything I mentioned above.

All 5 comments

What's the use case/consequences? Are we talking at connection/nick change, or the default nick in the server settings?
The underlying library (irc-framework) is already playing nice after setting the nick.

I was thinking more in the user settings:

If someone chooses an invalid nick (e.g. "///"), they get an erroneous nickname error, and the nick is changed to a random string.

If someone chooses an invalid username/ident (e.g. "///"), the USER message will get rejected, which freezes the connections and eventually leads to a Registration timeout.

I'm not exactly sure what the allowed characters are or whether they differ between networks but we could add a check to the connect form that only allows valid nicknames. Anyone aware of the specs of valid nicknames?

Officially I think that would be RFC 2812 section 1.2.1 that I don't understand, but having been on IRC for soon 10 years I think it would be better to give up.

Nicks may not begin with number. However nick collision nicks begin with numbers and that breaks clients that strictly follow the RFC (e.g. Supybot with strictrfc enabled is unable to do anything against a collision nick).

Some networks also accept 0 as a valid nickname changing your nick to your UID (what I above called collision nick), mainly IRCnet and anything running UnrealIRCd/InspIRCd (I don't remember which).

And if this wasn't enough, some IRC networks allow UTF-8 nicknames that I guess will allow almost anything as a nickname.

If blocking invalid characters is desirable, I would ask IRCv3 for a list of what are those invalid characters without breaking anything I mentioned above.

Pretty much what @Mikaela said. We don't know which characters are considered invalid by the server. Maybe it uses a different encoding altogether and allows for cyrillic letters, and we wouldn't want to block that.

Was this page helpful?
0 / 5 - 0 ratings