]> arthur.barton.de Git - ngircd.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 13:12:17 +0000 (15:12 +0200)
commitce3215acafe3d611c336a4d1e80bde93857b9539
tree4e145a07aeb6790ef1b587fae876e1fb4108c76b
parentedb59b8317e3b159d7080642b4a95b3d9a92e677
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.
(cherry picked from commit 8644cbf197807909e4caea184278872cdeca1963)
src/ngircd/parse.c