Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRC protocol bug with colon escaping of last argument #17

Open
MakeItGreatAgain opened this issue Jun 15, 2019 · 6 comments · May be fixed by #25
Open

IRC protocol bug with colon escaping of last argument #17

MakeItGreatAgain opened this issue Jun 15, 2019 · 6 comments · May be fixed by #25

Comments

@MakeItGreatAgain
Copy link

HydraIRC is not properly implementing the IRC spec in regards to escaping, which is causing some problems on servers with non-historical but perfectly valid (per the RFC) behavior in message tokenization.

The issue is that properly stripping the colon escaping is not always done on the last argument - while most servers do not escape the final string unless it contains spaces, a string containing no spaces may still be escaped and is valid.

You can verify the broken parsing behavior on testnet.inspircd.org for example, but this is affecting many newer servers. This is causing a lot of breakage, as you can see from the failure to parse the timestamp, and the extra ":"'s that are appearing in modes - this causes the client to desync from the server.

[11:23] *** channel #t6 mode is :+nt
[11:23] *** channel created at Wed Dec 31 17:00:00 1969
[11:23] *** testtrn sets channel #t6 mode +kl aa:bb :999

inspircd/inspircd#1636 has some additional information. This bug recently affected HexChat, AdiIRC,, irssi, and WeeChat, but those clients have all fixed their parsers. Interestingly, ircII was not affected (nor mIRC) but EPIC was (also patched in the upcoming release). The issue link above contains a link to parsing test cases, to help verify that your client is complaint to the specifications.

@MakeItGreatAgain
Copy link
Author

To clarify the initial modes should be "+nt". the timestamp is misparsed, and the final channel mode should be "+kl aa:bb 999" in that example.

(":" in the channel key is also valid as long as it doesn't appear as the first character of the key, even though many servers strip :'s from the key completely, the RFC allows this - I did the test this way to further exercise the parser).

@MakeItGreatAgain
Copy link
Author

This was tested using v0.3.202.

@SurenaSKQ
Copy link

If you're using 0.3.202 you're using my fork of hydra IRC which no longer exists, i stopped releasing it and deleted the repo due to lack of time for development.

It doesn't implement a lot of newer IRC features and has some bugs that never got fixed. I advice against using it.

@hydra
Copy link
Contributor

hydra commented Sep 9, 2023

@gdwnldsKSC do you fancy tackling this issue?

@gdwnldsKSC
Copy link
Contributor

Definitely will take a look, had quite a lengthy vacation recently :) Looks understandable enough.

@gdwnldsKSC gdwnldsKSC linked a pull request Oct 10, 2023 that will close this issue
@gdwnldsKSC
Copy link
Contributor

@hydra got a fix in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants