🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
21 messages
21 total messages Started by Julien ÉLIE Fri, 10 Jun 2016 20:47
Draft -03 for COMPRESS
#87460
Author: Julien ÉLIE
Date: Fri, 10 Jun 2016 20:47
87 lines
4242 bytes
Hi all,

As you may already know, TLS-level compression is no longer possible in 
TLS 1.2 whereas NNTP was relying on this feature provided by previous 
TLS versions to compress data.
We agreed that the right move was to standardize a new NNTP command.  It 
is what we finally did with the COMPRESS extension.
Interoperability is proven:  two news servers (INN, Cyrus NNTP) and a 
news client (flnews) have already implemented it.  It also works fine 
with Python nntplib+zlib libraries.

Here is the latest version of the draft:
     https://tools.ietf.org/html/draft-murchison-nntp-compress-03

If you have any comments, please don't hesitate to tell.



Changes since -02:

    o  Added text stating that the receiving end SHOULD terminate the
       connection when receiving invalid or corrupted compressed data.

    o  Explained why COMPRESS permits to do better than existing
       unstandardized commands like XZVER, XZHDR, MODE COMPRESS, and
       XFEATURE GZIP.

    o  The LIST capability label was missing in the examples when READER
       was also advertised.

    o  Improved an example to send CAPABILITIES after successful
       authentication.

    o  Mentioned that COMPRESS is related to security.  CAPABILITIES is
       therefore sent again after COMPRESS.

    o  Re-added discussion of attachments in binary form and
       incompressible file formats.  Improve the discussion about
       flushes, and add a specific section about DEFLATE.

    o  Change a MUST NOT to SHOULD NOT for the use of AUTHINFO after
       COMPRESS.

    o  Algorithm names are case-insensitive.

    o  Mentioned the use of the 501 response code.

    o  Added the Security Considerations Section.

    o  Added Julien Elie as co-author of this document.

    o  Minor editorial changes.




Issues to be addressed

    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...)
=> Question asked to the UTA and TLS IETF WG.  But in case you have an 
idea of response, you can of course give it.

    o  Anything to add to the Security Considerations section?  Whom
       should we get a review from?

    o  Should we add a naming convention for private compression
       algorithms?  (I am unsure that saying it begins with "X" is a good
       idea, though; we may one day see a standardized compression
       algorithm with such a name - XZ for instance, though LZMA2 would
       be its real name.)
=> Suggestion of not enforcing any naming convention (except that the 
name complies with the syntax of 20 alphanumeric chars, "-" and "_").


Thanks again for your useful comments!

-- 
Julien ÉLIE

« Pourvu que ça dure ! » (Letizia Bonaparte)

Re: Draft -03 for COMPRESS
#87461
Author: Julien ÉLIE
Date: Fri, 10 Jun 2016 21:32
13 lines
1526 bytes
> As you may already know, TLS-level compression is no longer possible in
> TLS 1.2 whereas NNTP was relying on this feature provided by previous
> TLS versions to compress data.

Of course one should read "TLS 1.3".

-- 
Julien ÉLIE

« I don't worry about terrorism.  I was married for two years. »
   (Sam Kinison)

Re: Draft -03 for COMPRESS
#87462
Author: Michael Baeuerle
Date: Sat, 11 Jun 2016 11:18
31 lines
2196 bytes
Julien ÉLIE wrote:
> 
> [...]
> Here is the latest version of the draft:
>     https://tools.ietf.org/html/draft-murchison-nntp-compress-03
> 
> If you have any comments, please don't hesitate to tell.
> 
> [...]
>    o  Should we add a naming convention for private compression
>       algorithms?  (I am unsure that saying it begins with "X" is a good
>       idea, though; we may one day see a standardized compression
>       algorithm with such a name - XZ for instance, though LZMA2 would
>       be its real name.)
> => Suggestion of not enforcing any naming convention (except that the 
> name complies with the syntax of 20 alphanumeric chars, "-" and "_").

My suggestion is to specify the convention that private algorithms (or
new ones in the test phase, before they become official) should use
the prefix "X-" and additionally reserve all names starting with "X" for
the same purpose.

This will prevent that "XZ" is specified as an official algorithm in the
future and follow the historical practice that "everything that starts
with X is an inofficial extension" (nothing breaks if somebody plays
with "XZ").

The dash in "X-" will make it more clear, that it is a prefix and not
part of the algorithm name.

Re: Draft -03 for COMPRESS
#87463
Author: Julien ÉLIE
Date: Sat, 11 Jun 2016 14:26
50 lines
3230 bytes
Hi Michael,

>>    o  Should we add a naming convention for private compression
>>       algorithms?  (I am unsure that saying it begins with "X" is a good
>>       idea, though; we may one day see a standardized compression
>>       algorithm with such a name - XZ for instance, though LZMA2 would
>>       be its real name.)
>> => Suggestion of not enforcing any naming convention (except that the
>> name complies with the syntax of 20 alphanumeric chars, "-" and "_").
>
> My suggestion is to specify the convention that private algorithms (or
> new ones in the test phase, before they become official) should use
> the prefix "X-" and additionally reserve all names starting with "X" for
> the same purpose.
>
> This will prevent that "XZ" is specified as an official algorithm in the
> future and follow the historical practice that "everything that starts
> with X is an inofficial extension" (nothing breaks if somebody plays
> with "XZ").
>
> The dash in "X-" will make it more clear, that it is a prefix and not
> part of the algorithm name.

Suggestion of wording:

%%
An NNTP compression algorithm is either a private algorithm, or its name 
is included in the IANA registry of NNTP compression algorithms (in 
which case it is a "registered NNTP compression algorithm").  Different 
entries in the registry MUST use different names.

Any name that conforms to the syntax of an NNTP compression algorithm 
name (Section 4.3) can be used.  However, the name of a registered NNTP 
compression algorithm MUST NOT begin with "X-", and submissions of NNTP 
compression algorithms to the IANA registry SHOULD avoid using a name 
beginning with "X" for their algorithm.

To avoid the risk of a clash with a future registered NNTP compression 
algorithm, the names of private compression algorithms SHOULD begin with 
"X-".
%%

Is it what you meant?

-- 
Julien ÉLIE

« Error communis facit ius. »

Re: Draft -03 for COMPRESS
#87464
Author: Michael Baeuerle
Date: Sun, 12 Jun 2016 09:03
50 lines
3188 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote
> > Julien ÉLIE wrote:
> > > 
> > >    o  Should we add a naming convention for private compression
> > >       algorithms?  (I am unsure that saying it begins with "X" is a good
> > >       idea, though; we may one day see a standardized compression
> > >       algorithm with such a name - XZ for instance, though LZMA2 would
> > >       be its real name.)
> > > => Suggestion of not enforcing any naming convention (except that the
> > > name complies with the syntax of 20 alphanumeric chars, "-" and "_").
> > 
> > My suggestion is to specify the convention that private algorithms (or
> > new ones in the test phase, before they become official) should use
> > the prefix "X-" and additionally reserve all names starting with "X" for
> > the same purpose.
> > 
> > This will prevent that "XZ" is specified as an official algorithm in the
> > future and follow the historical practice that "everything that starts
> > with X is an inofficial extension" (nothing breaks if somebody plays
> > with "XZ").
> > 
> > The dash in "X-" will make it more clear, that it is a prefix and not
> > part of the algorithm name.
> 
> Suggestion of wording:
> 
> %%
> An NNTP compression algorithm is either a private algorithm, or its 
> name is included in the IANA registry of NNTP compression algorithms 
> (in which case it is a "registered NNTP compression algorithm").  
> Different entries in the registry MUST use different names.
> 
> Any name that conforms to the syntax of an NNTP compression algorithm 
> name (Section 4.3) can be used.  However, the name of a registered NNTP 
> compression algorithm MUST NOT begin with "X-", and submissions of NNTP 
> compression algorithms to the IANA registry SHOULD avoid using a name 
> beginning with "X" for their algorithm.
> 
> To avoid the risk of a clash with a future registered NNTP compression 
> algorithm, the names of private compression algorithms SHOULD begin 
> with "X-".
> %%
> 
> Is it what you meant?

The "SHOULD avoid" and "SHOULD begin" are a bit softer. But yes, the
words are OK in my opinion.

Re: Draft -03 for COMPRESS
#87465
Author: Julien ÉLIE
Date: Sun, 12 Jun 2016 13:31
46 lines
3023 bytes
Hi Michael,

>> Is it what you meant?
>
> The "SHOULD avoid" and "SHOULD begin" are a bit softer. But yes, the
> words are OK in my opinion.

OK, we can say MUST instead of SHOULD.

Incidentally, Ángel González submitted an interesting suggestion:
     http://www.ietf.org/mail-archive/web/uta/current/msg01712.html

The issue of mixing compression and encryption is that an attacker can 
guess things when "public data" are compressed together with a 
confidential article.
Whence his suggestion of:
- adding a None algorithm;
- allowing COMPRESS to be called inside a COMPRESS session, replacing 
the previous one.

Thus, a client would be able to COMPRESS DEFLATE, read *public* 
newsgroups, COMPRESS NONE, read *secret* article(s), COMPRESS DEFLATE, 
do more public activity.
Or even call COMPRESS DEFLATE, read article A, COMPRESS DEFLATE,
read article B, etc. to ensure their contents are not compressed together.


It would imply that after the 206 response to COMPRESS, either the 
compression goes on with DEFLATE (after a full flush of a the server to 
clear the dictionary), or with another algorithm asked by the client, or 
without compression at all (NONE).

Does it sound also fine from the point of view of a news client?
Any concerns if we go into that direction?
The client will have to know somehow what kinds of newsgroups or 
articles need extra-security.
(The server could also send full flushes on its own if it knows that too.)

-- 
Julien ÉLIE

« – Ben où est l'eau ?
   – Elle est sortie quand tu es entré Obélix. Il n'y a pas de place
     pour vous deux là dedans ! » (Astérix)

Re: Draft -03 for COMPRESS
#87466
Author: Julien ÉLIE
Date: Sun, 12 Jun 2016 13:57
26 lines
2345 bytes
> Whence his suggestion of:
> - adding a None algorithm;
> - allowing COMPRESS to be called inside a COMPRESS session, replacing
> the previous one.
>
> Does it sound also fine from the point of view of a news client?  Any
> concerns if we go into that direction?

Hmm, maybe we could avoid extra complexity with:
- If a client wants to access both public groups and secret articles, 
why not open two separate NNTP connections (either in parallel or one 
after the other)?  These two sessions can be compressed, and there will 
be no leakage.
- Additionally, so as to ensure that the contents of two secret articles 
are not compressed together, we could call "COMPRESS DEFLATE FLUSH" (or 
another better optional argument) that asks the server to clear the 
compression dictionary after every NNTP response.

Any comment about that proposed behaviour?

-- 
Julien ÉLIE

« Ta remise sur pied lui a fait perdre la tête ! » (Astérix)

Re: Draft -03 for COMPRESS
#87467
Author: Michael Baeuerle
Date: Sun, 12 Jun 2016 14:23
15 lines
1554 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > Julien ÉLIE wrote:
> > > 
> > > Is it what you meant?
> > 
> > The "SHOULD avoid" and "SHOULD begin" are a bit softer. But yes, the
> > words are OK in my opinion.
> 
> OK, we can say MUST instead of SHOULD.

Maybe only for "MUST avoid". If a registered algorithm neven can begin
with "X", the "SHOULD begin" is IMHO sufficient.

Re: Draft -03 for COMPRESS
#87468
Author: Michael Baeuerle
Date: Sun, 12 Jun 2016 15:09
58 lines
3681 bytes
Julien ÉLIE wrote:
> Julien ÉLIE wrote:
> > 
> > Whence his suggestion of:
> > - adding a None algorithm;
> > - allowing COMPRESS to be called inside a COMPRESS session, replacing
> > the previous one.
> > 
> > Does it sound also fine from the point of view of a news client?  Any
> > concerns if we go into that direction?

In general I see the problem at layer 8: The user need to understand
what is going on and how to control things with the user interface of
the programs.
The same thing as with encrypted E-Mail: It's far too easy with most
programs to send confidential information as clear text by accident.

For security purposes it is likely already too much to expect that the
"compression on/off" switch is recognised as security relevant by the
users.
Therefore I think the best solution for security is to use a separate
newsreader (explicitly compiled without compression support) for
security relevant tasks.

> Hmm, maybe we could avoid extra complexity with:
> - If a client wants to access both public groups and secret articles, 
> why not open two separate NNTP connections (either in parallel or one 
> after the other)?  These two sessions can be compressed, and there will 
> be no leakage.
> - Additionally, so as to ensure that the contents of two secret 
> articles are not compressed together, we could call "COMPRESS DEFLATE 
> FLUSH" (or another better optional argument) that asks the server to 
> clear the compression dictionary after every NNTP response.
> 
> Any comment about that proposed behaviour?

I vote for not adding more complexity. The simple "compression on/off"
switch is very easy to implement and should be sufficient for nearly
all non academic scenarios.

But maybe the default setting for the switch should be defined as "off",
because this is the more secure option. Possible words instead of the
current:
| 
| Implementations MUST support a configuration where compression can be
| easily disabled.

---
Implementations SHOULD use a default configuration with disabled
compression and MUST support an option to easily enable compression
[either with global scope or server/connection based].
---

This will ensure that e.g. a new version of a newsreader with support
for compression will not enable it automatically (possibly without
knowledge of a user who have not read the changelog).

Re: Draft -03 for COMPRESS
#87469
Author: Avon Kerr
Date: Wed, 15 Jun 2016 09:05
14 lines
1267 bytes
On Fri, 10 Jun 2016 22:47:53 +0200, Julien ÉLIE wrote:

> Thanks again for your useful comments!


It's not really an area of expertise for me Julien, but thank you for the 
efforts that you are putting in to this :)

Best, Paul

-- 
Agency News | news.bbs.geek.nz

Re: Draft -03 for COMPRESS
#87470
Author: Julien ÉLIE
Date: Wed, 15 Jun 2016 20:53
55 lines
3473 bytes
Hi Michael,

> In general I see the problem at layer 8: The user need to understand
> what is going on and how to control things with the user interface of
> the programs.
> The same thing as with encrypted E-Mail: It's far too easy with most
> programs to send confidential information as clear text by accident.

Yep, you're right.


> For security purposes it is likely already too much to expect that the
> "compression on/off" switch is recognised as security relevant by the
> users.
> Therefore I think the best solution for security is to use a separate
> newsreader (explicitly compiled without compression support) for
> security relevant tasks.

I understand.


> I vote for not adding more complexity.  The simple "compression on/off"
> switch is very easy to implement and should be sufficient for nearly
> all non academic scenarios.
>
> But maybe the default setting for the switch should be defined as "off",
> because this is the more secure option. Possible words instead of the
> current:
>
> | Implementations MUST support a configuration where compression can be
> | easily disabled.
>
> ---
> Implementations SHOULD use a default configuration with disabled
> compression and MUST support an option to easily enable compression
> [either with global scope or server/connection based].
> ---

OK for the new wording.
I suggest to also say that news servers MAY have a global or connection 
based configuration parameter permitting to enforce more confidentiality 
on specific newsgroups (notably by ensuring for these newsgroups that 
the contents of two secret articles are not compressed together).  The 
server will then clear the compression dictionary before sending any 
article posted to these newsgroups.

I think it does no harm to say that.  It can give ideas to ensure 
protection is maximal for those wishing to implement that.

-- 
Julien ÉLIE

« Contra factum non datur argumentum. »

Re: Draft -03 for COMPRESS
#87471
Author: Michael Baeuerle
Date: Thu, 16 Jun 2016 09:01
50 lines
3518 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > [...]
> > But maybe the default setting for the switch should be defined as "off",
> > because this is the more secure option. Possible words instead of the
> > current:
> > 
> > | Implementations MUST support a configuration where compression can be
> > | easily disabled.
> > 
> > ---
> > Implementations SHOULD use a default configuration with disabled
> > compression and MUST support an option to easily enable compression
> > [either with global scope or server/connection based].
> > ---
> 
> OK for the new wording.
> I suggest to also say that news servers MAY have a global or connection 
> based configuration parameter permitting to enforce more 
> confidentiality on specific newsgroups (notably by ensuring for these 
> newsgroups that the contents of two secret articles are not compressed 
> together).  The server will then clear the compression dictionary 
> before sending any article posted to these newsgroups.
> 
> I think it does no harm to say that.  It can give ideas to ensure 
> protection is maximal for those wishing to implement that.

I think we can expect much more technical knowledge from server
administrators than from users of newsreaders. Therefore I agree:
More complex implementations should be allowed too.

I have modified my current implementation in flnews like this:
Version 0.13 only has a compile time switch 'CFG_CMPR_DISABLE' with
default value 1 (=> disabled). But recompiling a program is not an
"easy way" to enable something.
Version 0.14 (next release) will set this switch to 0 by default
(=> compression module will be compiled). To control the compression
I have added a boolean parameter to the configfile and a GUI checkbox
to toggle it (nonvolatile):
<http://micha.freeshell.org/tmp/2016-06-16_flnews_config-window.png>
(3 clicks into menu "Edit->Configuration")
The default setting after updating from previous versions will be
"deactivated".

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).

Re: Draft -03 for COMPRESS
#87472
Author: Julien ÉLIE
Date: Thu, 16 Jun 2016 19:46
102 lines
6198 bytes
Hi Michael,

>> I suggest to also say that news servers MAY have a global or connection
>> based configuration parameter permitting to enforce more
>> confidentiality on specific newsgroups (notably by ensuring for these
>> newsgroups that the contents of two secret articles are not compressed
>> together).  The server will then clear the compression dictionary
>> before sending any article posted to these newsgroups.
>
> I think we can expect much more technical knowledge from server
> administrators than from users of newsreaders. Therefore I agree:
> More complex implementations should be allowed too.

OK, I'll take that into account for the next version.

At one time, I was wondering whether a new "LIST SECRETGROUPS"-like 
command would be useful to list "confidential" newsgroups but on second 
thoughts, I think it would in fact leak information about the name of 
confidential newsgroups, so it is a bad idea.
Do not hesitate to tell if you have another idea for a LIST command 
related to COMPRESS.

Anything else to fix in the draft?


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).



> I have modified my current implementation in flnews like this:
> Version 0.13 only has a compile time switch 'CFG_CMPR_DISABLE' with
> default value 1 (=> disabled). But recompiling a program is not an
> "easy way" to enable something.
> Version 0.14 (next release) will set this switch to 0 by default
> (=> compression module will be compiled). To control the compression
> I have added a boolean parameter to the configfile and a GUI checkbox
> to toggle it (nonvolatile):
> <http://micha.freeshell.org/tmp/2016-06-16_flnews_config-window.png>
> (3 clicks into menu "Edit->Configuration")
> The default setting after updating from previous versions will be
> "deactivated".

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


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?

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



> 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, and 502 instead of 480 after COMPRESS 
is used without being authenticated and the NNTP command is not 
available (AUTHINFO will then respond 502, but INN should have given 502 
just before, instead of 480).

-- 
Julien ÉLIE

« A man inserted an 'ad' in the classifieds:  "Wife wanted".
   Next day he received a hundred letters.
   They all said the same thing:  "You can have mine." »

Re: Draft -03 for COMPRESS
#87473
Author: 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.

Re: Draft -03 for COMPRESS
#87475
Author: Julien ÉLIE
Date: Sat, 18 Jun 2016 20:45
77 lines
4847 bytes
Hi Michael,

>> 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 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.

It was exactly what I meant.
Thanks for having confirmed the wording of the draft should not be 
altered, and that these "TLS specific exchanges" are out of band.


> 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.

It makes me think that I should test how INN behaves if I try to POST a 
compressed article composed with headers and several billions of the 
same line as body + "CRLF.".
Though the internal buffer INN uses should not expand beyond the maximal 
size of a local article, I am interested in making sure it copes with 
that crafted article.


> 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.

Adopted in the -04 draft, then.


> 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)

Looks fine.


>> 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.

Noted.

-- 
Julien ÉLIE

« Pour célébrer ce jour heureux, buvons un coup, buvons-en deux. »
   (Aristophane)

Re: Draft -03 for COMPRESS
#87508
Author: Julien ÉLIE
Date: Tue, 02 Aug 2016 19:03
42 lines
2627 bytes
Hi Michael,

>> 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.

Now done.  You can test it if you want.
Here are examples of handled cases:

[C] COMPRESS
[S] 501 Syntax is:  COMPRESS DEFLATE

[C] COMPRESS ARG ARG
[S] 501 Syntax is:  COMPRESS DEFLATE

[C] COMPRESS \x02
[S] 501 Syntax error in compression algorithm

[C] COMPRESS NOT.VALID
[S] 501 Syntax error in compression algorithm

[C] COMPRESS AAAAAAAAAAAAAAAAAAAAA
[S] 501 Syntax error in compression algorithm

[C] COMPRESS UNKNOWN
[S] 503 Only the DEFLATE compression algorithm is supported



Do not hesitate to tell me if you notice something wrong.

-- 
Julien ÉLIE

« – Vous n'avez rien à déclarer ?
   – J'ai faim.
   – Qu'est-ce que vous avez là ?
   – Un creux ! » (Obélix)

Re: Draft -03 for COMPRESS
#87507
Author: Julien ÉLIE
Date: Tue, 02 Aug 2016 19:59
25 lines
2536 bytes
> It makes me think that I should test how INN behaves if I try to POST a
> compressed article composed with headers and several billions of the
> same line as body + "CRLF.".
> Though the internal buffer INN uses should not expand beyond the maximal
> size of a local article, I am interested in making sure it copes with
> that crafted article.

Nothing special happens.  The article is discarded.
Another interesting thing is to send millions of "0" in one line.  I 
just see lots of the following line in the logs:

Aug  2 21:44:54 news nnrpd[15490]: denver.dinauz.org overflowed our line 
buffer (600000), discarding further input

The news server still works fine, unaffected.  So that's great!

-- 
Julien ÉLIE

« – Vous n'avez rien à déclarer ?
   – J'ai faim.
   – Qu'est-ce que vous avez là ?
   – Un creux ! » (Obélix)

Re: Draft -03 for COMPRESS
#87506
Author: Michael Bäuerle
Date: Thu, 04 Aug 2016 16:20
129 lines
5114 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > 
> > [COMPRESS implementation for INN]
> > Please note me when it's finished. The error handling of flnews for the
> > compression negotiation should be tested.
> 
> Now done.  You can test it if you want.
> Here are examples of handled cases:
> 
> [C] COMPRESS
> [S] 501 Syntax is:  COMPRESS DEFLATE
> 
> [C] COMPRESS ARG ARG
> [S] 501 Syntax is:  COMPRESS DEFLATE
> 
> [C] COMPRESS \x02
> [S] 501 Syntax error in compression algorithm
> 
> [C] COMPRESS NOT.VALID
> [S] 501 Syntax error in compression algorithm
> 
> [C] COMPRESS AAAAAAAAAAAAAAAAAAAAA
> [S] 501 Syntax error in compression algorithm
> 
> [C] COMPRESS UNKNOWN
> [S] 503 Only the DEFLATE compression algorithm is supported
> 
> 
> 
> Do not hesitate to tell me if you notice something wrong.

I have found no problems. Anything worked as expected for INN
and flnews.


Scenario 1 (invalid command):
------------------------------------------------------------------------
[...]
[=>] CAPABILITIES
[<=] 101 Capability list:
[<= Expect multiline data block]
VERSION 2
IMPLEMENTATION INN 2.7.0 (20160802 snapshot)
COMPRESS DEFLATE
[...]
[=>] COMPRESSx DEFLATE
[<=] 500 What?
[Enabling compression failed]
[=>] GROUP trigofacile.test
[...]
------------------------------------------------------------------------

Scenario 2 (unsupported compression algorithm):
------------------------------------------------------------------------
[...]
[=>] CAPABILITIES
[<=] 101 Capability list:
[<= Expect multiline data block]
VERSION 2
IMPLEMENTATION INN 2.7.0 (20160802 snapshot)
COMPRESS DEFLATE
[...]
[=>] COMPRESS XDEFLATE
[<=] 503 Only the DEFLATE compression algorithm is supported
[Enabling compression failed]
[=>] GROUP trigofacile.test
[...]
------------------------------------------------------------------------

Scenario 3 (invalid command syntax):
------------------------------------------------------------------------
[...]
[=>] CAPABILITIES
[<=] 101 Capability list:
[<= Expect multiline data block]
VERSION 2
IMPLEMENTATION INN 2.7.0 (20160802 snapshot)
COMPRESS DEFLATE
[...]
[=>] COMPRESS A DEFLATE
[<=] 501 Syntax is:  COMPRESS DEFLATE
[Enabling compression failed]
[=>] GROUP trigofacile.test
[...]
------------------------------------------------------------------------

Scenario 4 (normal, working behaviour with capability refresh):
------------------------------------------------------------------------
[...]
[=>] CAPABILITIES
[<=] 101 Capability list:
[<= Expect multiline data block]
VERSION 2
IMPLEMENTATION INN 2.7.0 (20160802 snapshot)
COMPRESS DEFLATE
[...]
[=>] COMPRESS DEFLATE
[<=] 206 Compression now active; enjoy the speed!
[=>] CAPABILITIES
[<=] 101 Capability list:
[<= Expect multiline data block]
VERSION 2
IMPLEMENTATION INN 2.7.0 (20160802 snapshot)
HDR
LIST ACTIVE ACTIVE.TIMES COUNTS DISTRIB.PATS DISTRIBUTIONS HEADERS MODERATORS MOTD NEWSGROUPS OVERVIEW.FMT SUBSCRIPTIONS
OVER
POST
READER
SASL GSSAPI OTP PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5
XPAT
[=>] GROUP trigofacile.test
[...]
[=>] QUIT
[<=] 205 Bye!
[Compression layer terminated]
[Encryption layer terminated]
[Close connection]
------------------------------------------------------------------------

For the last (working) case, the COMPRESS capability was correctly
removed from the list by INN.

For all the error cases above, the NNTP connection still worked (was
used by flnews without compression transparently).

Looks good.

Re: Draft -03 for COMPRESS
#87509
Author: Julien ÉLIE
Date: Thu, 04 Aug 2016 18:59
16 lines
2072 bytes
Hi Michael,

> For all the error cases above, the NNTP connection still worked (was
> used by flnews without compression transparently).
>
> Looks good.

Thanks for having taken the time to test!

-- 
Julien ÉLIE

« La terre étant ronde, le kilomètre devrait être rond et non pas
   carré. » (Ramón Gomez de La Serna)

Re: Draft -03 for COMPRESS
#87527
Author: Julien ÉLIE
Date: Mon, 12 Sep 2016 20:14
30 lines
2347 bytes
Hi Michael,

>>    o  Should we add a naming convention for private compression
>>       algorithms?  (I am unsure that saying it begins with "X" is a good
>>       idea, though; we may one day see a standardized compression
>>       algorithm with such a name - XZ for instance, though LZMA2 would
>>       be its real name.)
>
> My suggestion is to specify the convention that private algorithms (or
> new ones in the test phase, before they become official) should use
> the prefix "X-" and additionally reserve all names starting with "X" for
> the same purpose.

It seems that the "X-" convention is now deprecated in application 
protocols...
     https://tools.ietf.org/html/rfc6648

Appendix B gives an interesting rationale for that change.

I bet the IESG will ask to reword what we put in the draft for COMPRESS 
to reflect that new best current practice.
The draft is in IETF Last Call during a month starting from today. 
We're moving forward!

-- 
Julien ÉLIE

« C'est une liqueur de grain distillée en Calédonie. » (Astérix)

Re: Draft -03 for COMPRESS
#87528
Author: Michael Bäuerle
Date: Mon, 12 Sep 2016 20:41
21 lines
1655 bytes
Julien ÉLIE wrote:
> 
> [...]
> It seems that the "X-" convention is now deprecated in application 
> protocols...
>     https://tools.ietf.org/html/rfc6648
> 
> Appendix B gives an interesting rationale for that change.
>  
> I bet the IESG will ask to reword what we put in the draft for COMPRESS 
> to reflect that new best current practice.

Yes. Simply removing our wording about the special meaning of "X-" names
should be sufficient to match RFC6648 requirements.

> The draft is in IETF Last Call during a month starting from today. 
> We're moving forward!

Nice to read.

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