🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87473

Re: Draft -03 for COMPRESS

#87473
From: Michael Baeuerle
Date: Fri, 17 Jun 2016 10:47
107 lines
6591 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> [...]
> I am still a bit puzzled by that:
>    o  How are TLS (and SASL) specific exchanges supposed to be handled?
>       Should it be mentioned in the RFC that they are outside the scope
>       of NNTP compression?  (I speak of stuff like TLS handshakes,
>       renegotiations, etc. that can occur after the use of COMPRESS.
>       OpenSSL may use SSL_read/SSL_write on its own, mayn't it?  And it
>       does not know that it should compress data...)
> 
> Maybe we should not say anything (when both an SASL confidentiality 
> layer and TLS are in use, the RFC for AUTHINFO SASL does not say 
> anything about that similar "issue" of adding the SASL confidentiality 
> layer during a TLS renegotiation; maybe there is no issue at all in 
> fact; I do not see much documentation about how SSL_read/SSL_write 
> behaves during TLS specific exchanges).

Maybe I misunderstood what you mean with "TLS specific exchange", but
I think that all the data used for the TLS protocol itself can be
considered "out of band" because they contain no NNTP related payload.
Only the result of changing connection parameters will affect our
payload.

TLS (as the lowest layer) should not do compression if an application
implements the new RFC. This is already defined in section 2.2.2 and I
think the scope of this definition extends to TLS renegotiations (it
makes no sense to first reject TLS compression at the first negotiation,
then negotiate NNTP compression and finally renegotiate at TLS level to
use compression too). If an application wants a simple and safe
solution, it can disable TLS renegotiations completely (the same way
as compression parameter change is defined: QUIT, close connection
and renegotiate the new algorithm).

If SASL is considered as an authentication replacement for AUTHINFO,
it is a similar case: SASL based authentication should be done via
TLS (because most algorithms used with SASL are old and likely crypto-
graphically weak today) but before compression is enabled.

> > [New compression configuration for flnews]
> 
> That's a good idea.
> No hint in the "Negotiate compression if available" text that it is not 
> recommended when confidential newsgroups are accessed?

Currently not, but see below.

> Hmm, shouldn't we be smarter for negotiating compression and reword the 
> draft to say something like:
> "Implementations SHOULD use a default configuration with disabled 
> compression when a security layer is active, and MUST support an option 
> to easily enable compression when a security layer is active [either 
> with global scope or server/connection based].  Implementations MAY 
> unconditionally support and negotiate compression when no security 
> layer is active."
> 
> As a matter of fact, there is no security problem when TLS or SASL are 
> not used; so why going without the improvement of compressing data when 
> there is no security layer?
> Does it sound good for you?

I don't agree that there can't be additional security problems without
TLS/SASL:
With compression additional code is used inside and outside the program.
For DEFLATE it is zlib outside and the corresponding buffer handling
inside. I think of things like this:
<http://www.kb.cert.org/vuls/id/680620>
As an example of the inside case, in flnews 0.13 a bug was fixed in the
overview parser that was only exploitable in NNTP V2 mode. Using the old
RFC977 protocol, without OVER command, this vulnerability was not
exposed to the server.

Both are examples for:
- If it's not there, it can't be broken
- It it's not used, it can't fail

But I nevertheless agree with your suggested words above, because the
compression gives real benefit that can justify the additional risk.
It should be the implementation and/or the user who decides what is the
desired solution for a specific use case.

> The name of the checkbox may then be "Negotiate compression with TLS if 
> available (not recommended when confidential newsgroups are accessed)".

As label for the checkbox this would be too long. But the hint in
parenthesis can be attached as a tooltip (that becomes visible if the
user places the mouse pointer over the label):
<http://micha.freeshell.org/tmp/2016-06-17_flnews_config-window_de.png>
(Screenshot with NLS and german locale)

> > This implementation should now be compliant to the new words for
> > "easy" and the cases "global scope" and "server based" (because
> > flnews doesn't support multiple servers).
> 
> Yep.  I also need updating INN to have a boolean parameter like yours. 
> I think I will only add a global true/false parameter in inn.conf and 
> not bother with readers.conf to tweak newsgroups access per connection. 
> It could be an improvement in future versions when more news clients 
> have implemented COMPRESS.
> I also have to implement the right 501 response code when the algorithm 
> name is not syntactically correct, [...] 

Please note me when it's finished. The error handling of flnews for the
compression negotiation should be tested.

Technical Details
Message-ID: <AABXY9ValdcAAErq.A1.flnews@WStation5.stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
References: <njf91p$b3i$1@news.trigofacile.com> <AABXW+4JgdcAAA2l.A1.flnews@Server4.micha.freeshell.org> <njh71t$gq3$1@news.trigofacile.com> <AABXXSM2rvcAAAt6.A1.flnews@Server4.micha.freeshell.org> <njjo6n$ct3$1@news.trigofacile.com> <njjpno$eit$1@news.trigofacile.com> <AABXXXroib0AAA1G.A1.flnews@Server4.micha.freeshell.org> <njsf8k$663$1@news.trigofacile.com> <AABXYmsFDv0AAAd+.A1.flnews@WStation5.stz-e.de> <njuvm7$v0s$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <AABXY9ValdcAAErq.A1.flnews@WStation5.stz-e.de>
Subject: Re: Draft -03 for COMPRESS
Date: Fri, 17 Jun 2016 12:47:54 +0200
From: Michael Baeuerle <michael.baeuerle@stz-e.de>
References: <njf91p$b3i$1@news.trigofacile.com> <AABXW+4JgdcAAA2l.A1.flnews@Server4.micha.freeshell.org> <njh71t$gq3$1@news.trigofacile.com> <AABXXSM2rvcAAAt6.A1.flnews@Server4.micha.freeshell.org> <njjo6n$ct3$1@news.trigofacile.com> <njjpno$eit$1@news.trigofacile.com> <AABXXXroib0AAA1G.A1.flnews@Server4.micha.freeshell.org> <njsf8k$663$1@news.trigofacile.com> <AABXYmsFDv0AAAd+.A1.flnews@WStation5.stz-e.de> <njuvm7$v0s$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Lines: 105
Reply-To: Michael Baeuerle <michael.baeuerle@gmx.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=fixed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net tchg1rQU1z9P4xEN4oNllAM/Zrfp77iR+wTCUaY8jlCjtpV8WF
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:eqZ7R/hnARzS4ImsrImI13gVzeY= sha1:nOLQIQCQRdU08twS5teLTUELYps=
Injection-Date: Fri, 17 Jun 2016 10:47:54 -0000
User-Agent: flnews/0.14pre35 (for NetBSD)
X-Received-Body-CRC: 2160333709
X-Received-Bytes: 6450