]> arthur.barton.de Git - ngircd-alex.git/commit
Don't allow stray \r or \n in command parameters
authorAlexander Barton <alex@barton.de>
Fri, 30 May 2008 12:49:56 +0000 (14:49 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 30 May 2008 12:58:25 +0000 (14:58 +0200)
commit8644cbf197807909e4caea184278872cdeca1963
tree68f82dcf709b592babcc7aff8ac54d25b8cf62a4
parent4c121f277da634d62a382457eb1df354cfb77b9b
Don't allow stray \r or \n in command parameters

If ngircd receives an input line like "COMMAND arg\nIRRELEVANT\r\n",
"arg\nIRRELEVANT" is passed as an argument to COMMAND. This can lead
to output like:

:ngircd.test.server 322 nick #chan 1 :
topicwithprecedingnewline
:ngircd.test.server 322 nick #nxtchan 1 :
[..]

Worse, this allows clients to piggyback irc commands, e.g.
"TOPIC #a :test\n:fake!~a@nonexistant JOIN :#a\r\n", which
causes the client to receive a JOIN command during /LIST output.

Bug reported by Scott Perry, first patch by Florian Westphal.
src/ngircd/parse.c