Subject: bug#36233: 26.2; Tokenization error in rcirc parser

From: "Jeff Johnson" <[email-masked]>
Date: Sat, 15 Jun 2019 18:01:38 -0400

I'm reporting a bug that has to do with unused IRC
protocol colon escaping combined with the use of
certain unusual but not disallowed characters in 
channel keys.

It should be noted that certain IRC servers that
always colon escape the last token, (pedantic, but
certainly valid per the IRC RFC's) often triggers a class
of bugs, to most of which rcirc is immune, except when
combing the use of ':' in a channel key, which leads the
to the channel key being stripped of the ':' but not
final argument.

Example, if the server sends:
"MODE #cchan +kl a:b :999" 

That is somehow parsed by rcirc as:
"MODE +kl a b :999"

Clearly incorrect - it should be "MODE +kl a:b 999".

The colon *is* allowed as part of the channel key (as it
is not disallowed in the RFC), except, of course, as the
first character of the key, where it would break protocol.

ircrc client does parse the case of "MODE #chan +k :a:b" 
correctly, yet fails for "MODE #chan +kl a:b :999".

An example of an ircd that always escapes the final token 
and does not disallow colons in channel keys is inspircd, 
but there are many others.  inspircd exactly follows the
RFC - pedantically so - but does not conform to historical
behavior - only standards compliance. 

Inspircd has a testnet at testnet.inspircd.org which can be    
easily used to reproduce the behavior reported.

I've tested that this bugs exists and is reproducible on both
Emacs 26.2 and 25.1 with the included rcirc.

--  
Jeff Johnson
[email-masked]