Thread View: news.software.nntp
4 messages
4 total messages
Started by Julien ÉLIE
Tue, 15 Mar 2011 22:55
STARTTLS / SASL and plaintext command injection
Author: Julien ÉLIE
Date: Tue, 15 Mar 2011 22:55
Date: Tue, 15 Mar 2011 22:55
44 lines
2517 bytes
2517 bytes
Hi all,
An interesting report (CVE-2011-0411):
http://www.postfix.org/CVE-2011-0411.html
I have not tested with INN but at first thought, I do not see why it
would not be impacted (nnrpd/line.c goes on reading the input of commands).
I write in this public newsgroup because CVE-2011-0411 is public.
An example would be to send:
STARTTLS\r\nARTICLE <private@article.id>\r\n
INN (and maybe other servers) will negotiate the TLS layer and then run
the subsequent command as though it had been sent encrypted (whereas in
fact it was sent before the security layer was negotiated).
Probably the same problem affects AUTHINFO SASL with a negotiation of a
TLS layer.
But why doesn't this article address it? (Don't similar SASL
authentication commands exist in SMTP?)
Wouldn't it be interesting to answer 501 (syntax error) or another
response code when a command which should not be pipelined has in fact
been detected as pipelined?
Otherwise, another straightforward solution would be to drop what is in
the read buffer when the TLS layer has been negotiated successfully.
I think that just setting
line->where = line->where + line->remaining;
in nnrpd/nnrpd.c does the trick.
Any thoughts about that?
That would also be something worthwhile mentioning in RFC 4642 and RFC 4643.
--
Julien ÉLIE
« C'est comme chercher une aiguille dans du foin en bottes ! »
(Jolitorax)
Re: STARTTLS / SASL and plaintext command injection
Author: D. Stussy
Date: Wed, 16 Mar 2011 21:52
Date: Wed, 16 Mar 2011 21:52
46 lines
2914 bytes
2914 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message news:8ua932Fhr1U1@mid.individual.net... > Hi all, > An interesting report (CVE-2011-0411): > http://www.postfix.org/CVE-2011-0411.html > > I have not tested with INN but at first thought, I do not see why it > would not be impacted (nnrpd/line.c goes on reading the input of commands). > I write in this public newsgroup because CVE-2011-0411 is public. > > An example would be to send: > > STARTTLS\r\nARTICLE <private@article.id>\r\n > > INN (and maybe other servers) will negotiate the TLS layer and then run > the subsequent command as though it had been sent encrypted (whereas in > fact it was sent before the security layer was negotiated). > > > Probably the same problem affects AUTHINFO SASL with a negotiation of a > TLS layer. > But why doesn't this article address it? (Don't similar SASL > authentication commands exist in SMTP?) > > > Wouldn't it be interesting to answer 501 (syntax error) or another > response code when a command which should not be pipelined has in fact > been detected as pipelined? > > > Otherwise, another straightforward solution would be to drop what is in > the read buffer when the TLS layer has been negotiated successfully. > I think that just setting > line->where = line->where + line->remaining; > in nnrpd/nnrpd.c does the trick. > > Any thoughts about that? > > That would also be something worthwhile mentioning in RFC 4642 and RFC 4643. Flushing the input stream [after accepting STARTTLS] before sending out the first TLS negotiation packet seems to be the correct action.
Re: STARTTLS / SASL and plaintext command injection
Author: Julien ÉLIE
Date: Sun, 03 Apr 2011 15:24
Date: Sun, 03 Apr 2011 15:24
134 lines
5091 bytes
5091 bytes
Hi all,
> An interesting report (CVE-2011-0411):
> http://www.postfix.org/CVE-2011-0411.html
>
> I have not tested with INN but at first thought, I do not see why it
> would not be impacted (nnrpd/line.c goes on reading the input of
> commands). I write in this public newsgroup because CVE-2011-0411 is
> public.
Confirmed when I send "STARTTLS\r\nDATE\r\n" with openssl:
17:04 news@trigo ~/work/openssl/openssl-1.0.0d% apps/openssl s_client -quiet -starttls smtp -connect news.trigofacile.com:119
didn't found starttls in server response, try anyway...
depth=0 C = FR, ST = news.trigofacile.com, O = news.trigofacile.com, CN = news.trigofacile.com
verify error:num=18:self signed certificate
verify return:1
depth=0 C = FR, ST = news.trigofacile.com, O = news.trigofacile.com, CN = news.trigofacile.com
verify return:1
500 What?
111 20110403150413
QUIT
205 Bye!
The 500 artefact is because of the EHLO sent by openssl before STARTTLS.
You see here that the DATE command is answered.
For those who want to fix it (before waiting for the next 2.5.3 release),
here is a patch.
The issue has been present since INN 2.3.0 (when STARTTLS was implemented).
Index: nnrpd.h
===================================================================
--- nnrpd.h (révision 9183)
+++ nnrpd.h (copie de travail)
@@ -291,6 +291,7 @@
void line_free(struct line *);
void line_init(struct line *);
+void line_reset(struct line *);
READTYPE line_read(struct line *, int, const char **, size_t *, size_t *);
#ifdef HAVE_SASL
Index: line.c
===================================================================
--- line.c (révision 9183)
+++ line.c (copie de travail)
@@ -67,6 +67,17 @@
}
/*
+** Reset a line structure.
+*/
+void
+line_reset(struct line *line)
+{
+ assert(line);
+ line->where = line->start;
+ line->remaining = 0;
+}
+
+/*
** Timeout is used only if HAVE_SSL is defined.
*/
static ssize_t
Index: sasl.c
===================================================================
--- sasl.c (révision 9183)
+++ sasl.c (copie de travail)
@@ -326,6 +326,9 @@
GRPcount = 0;
PERMgroupmadeinvalid = false;
}
+
+ /* Reset our read buffer so as to prevent plaintext command injection. */
+ line_reset(&NNTPline);
}
} else {
/* Failure. */
Index: misc.c
===================================================================
--- misc.c (révision 9183)
+++ misc.c (copie de travail)
@@ -518,5 +518,8 @@
GRPcount = 0;
PERMgroupmadeinvalid = false;
}
+
+ /* Reset our read buffer so as to prevent plaintext command injection. */
+ line_reset(&NNTPline);
}
#endif /* HAVE_SSL */
With this patch, here is a new attempt with openssl:
17:06 news@trigo ~/work/openssl/openssl-1.0.0d% apps/openssl s_client -quiet -starttls smtp -connect news.trigofacile.com:119
didn't found starttls in server response, try anyway...
depth=0 C = FR, ST = news.trigofacile.com, O = news.trigofacile.com, CN = news.trigofacile.com
verify error:num=18:self signed certificate
verify return:1
depth=0 C = FR, ST = news.trigofacile.com, O = news.trigofacile.com, CN = news.trigofacile.com
verify return:1
500 What?
DATE
111 20110403150638
QUIT
205 Bye!
The answer to DATE is not given after "500 What?". I had to explicitly
ask for it.
The issue is therefore solved.
It would be worthwhile mentioning it in RFC 4642 and RFC 4643.
--
Julien ÉLIE
« Petite annonce : Femme perdue cherche cartographe pour planifier
leur futur. »
Re: STARTTLS / SASL and plaintext command injection
Author: Michael Grimm
Date: Sun, 03 Apr 2011 20:50
Date: Sun, 03 Apr 2011 20:50
11 lines
1917 bytes
1917 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> wrote: > For those who want to fix it (before waiting for the next 2.5.3 release), > here is a patch. Merci beaucoup! I will have to upgrade to a recent 2.6.0 soon. Regards, Michael -- to let
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads