Article View: news.software.readers
Article #263504Re: 80 character header limits?
From: Michael Bäuerle
Date: Thu, 28 Mar 2019 10:00
Date: Thu, 28 Mar 2019 10:00
112 lines
6287 bytes
6287 bytes
VanguardLH wrote:
> Michael Bäuerle wrote:
> > Eli the Bearded wrote:
> > > In news.software.readers, VanguardLH <V@nguard.LH> followed up to me:
> > > >
> > [...] The current RFC 5537 [2] says:
> > |
> > | If the resulting References header field would, after unfolding,
> > | exceed 998 characters in length (including its field name but not the
> > | final CRLF), it MUST be trimmed (and otherwise MAY be trimmed).
> > | Trimming means removing any number of message identifiers from its
> > | content, except that the first message identifier and the last two
> > | MUST NOT be removed.
> >
> > The algorithm above ("peeling them off at the second ID [...]") is fully
> > compliant.
> >
> > > [...]
> > > Since you've prompted me to consult the RFCs, 821 has 1000 octets as
> > > the limit and includes the CRLF in that, hence 998.
> > >
> > > > https://tools.ietf.org/html/rfc5536
> > > > Section 3.1.1 - Message-ID
> > > > "The <msg-id> MUST NOT be more than 250 octets in length."
> > [...]
>
> I looked at RFC 5322 on the Message-ID header. In section , the msg-id
> definition doesn't specify the maximum size of the id-left and id-right
> tokens, as in <id-left@id-right>. The RFC says msg-id is a limited form
> of the addr-spec token, so I looked at that in section 3.4. Still no
> mention of maximums for the local-part and domain tokens, as in
> <local-part@domain>.
>
> With no specified maximums in the RFC, it seems a Message-ID's value
> could be up to 986 characters long:
>
> Message-ID: <id-left@id-right>
> \_12 chars_/\___986 chars____/
> \__________998 chars_________/
>
> If you are correct that the unrolled maximum length for the References
> header is still 998 characters, then its value's maximum length is also
> 986 characters, as in:
>
> References: {message-id-list}
> \_12 chars_/\___986 chars___/
> \__________998 chars________/
But only for Mail. For News the length is limited by RFC 5536 [3] to
250 octets (including the angle brackets). This always allows the
trimming algorithm required by [2] to place the mandatory three MIDs.
References: {maximum-length-mid} {maximum-length-mid} {maximum-length-mid}
\_12 chars_/\____250 chars_____/1\____250 chars_____/1\____250 chars_____/
\_______________________________764 chars________________________________/
Any potential CFWS can be stripped to SP (if it should be too long),
therefore the length 1 for the delimiters in the calculation above.
This is specific to News too (for Mail back-to-back MIDs are allowed).
> If a troll used an excessily long msg-id of 986 characters, that means
> the References header could contain only 1 Message-ID value, which must
> the parent of an entire subthread. The subthread could be quite deep,
> but a troll's reply with the excessively long msg-id would have its
> References header pointing to the upmost parent of a [sub]thread.
> Although a reply, the article would get threaded under the first article
> in the thread. The troll doesn't need to use a 986-character msg-id
> value. It could be 200 characters long and after a few replies by the
> troll the threading gets screwed up due to truncating the References
> header.
Such an article should not reach the network according to RFC 5537 [4]:
|
| An injecting agent processes proto-articles as follows:
| [...]
| 2. It MUST reject any proto-article that does not have the proper
| mandatory header fields for a proto-article, that has Injection-
| Info or Xref header fields, that has a Path header field
| containing the "POSTED" <diag-keyword>, or that is not
| syntactically valid as defined by [RFC5536]. [...]
^^^^^^^^^^^^^^^^^^^
If such an article nevertheless have passed injection, then it may not
work correctly (like any other syntactically invalid article).
> What limits, if anything, the maximum length of the Message-ID header's
> value (the msg-id value)?
<msg-id> is limited by [3] to 250 octets.
> While the domain token may be limited to 255
> octets, what limits the length of the local-part or id-left tokens?
I think both can have arbitrary length (at least <dot-atom-text> has no
length limit) as long as the 250 octet limit for the whole <msg-id> is
respected.
> On
> just the 255 limit on the domain or id-right tokens, it wouldn't take
> many replies by a poster with such a hugely long token to end up causing
> References to get truncated (trimmed) to screw up the threading with
> just a 998-char limit on the header length.
In general a (folded) header field has no length limit at all.
Therefore both values (250 for <msg-id> and 998 for the whole References
header field) are artificial limits only for News.
> > __________________
> > [2] <https://tools.ietf.org/html/rfc5537#section-3.4.4>
[3] <https://tools.ietf.org/html/rfc5536#section-3.1.3>
[4] <https://tools.ietf.org/html/rfc5537#section-3.5>
Technical Details
Message-ID:
<AABcnJsvICIAAAZT.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.readers.(126883).mbox.7z!not-for-mailReferences:
<c18onk.9d4.19.1@news.alt.net> <eli$1903011515@qaz.wtf> <1brxy36ifclri.dlg@v.nguard.lh> <eli$1903020051@qaz.wtf> <AABceojHSbgAAAnn.A1.flnews@Server4.micha.freeshell.org> <3jqehvxw2xcx.dlg@v.nguard.lh>Show Full Headers
Complete Article Headers
Message-ID: <AABcnJsvICIAAAZT.A1.flnews@WStation5.stz-e.de> Subject: Re: 80 character header limits? Date: Thu, 28 Mar 2019 10:00:15 +0000 From: Michael Bäuerle <michael.baeuerle@stz-e.de> References: <c18onk.9d4.19.1@news.alt.net> <eli$1903011515@qaz.wtf> <1brxy36ifclri.dlg@v.nguard.lh> <eli$1903020051@qaz.wtf> <AABceojHSbgAAAnn.A1.flnews@Server4.micha.freeshell.org> <3jqehvxw2xcx.dlg@v.nguard.lh> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail Newsgroups: news.software.readers Lines: 112 Reply-To: Michael Bäuerle <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 OzOgtQti+B/l7niD8G8V5wJjCqpJXw34TKgCYffELwQsBFhCOt X-Orig-Path: not-for-mail Cancel-Lock: sha1:HFnXZbvYLn8Pvni64M48j+yPkck= sha256:zgktfHUJbm6Q1ZgkmbTDgusb+rWm4UE3RsAy3b3Ye6w= sha1:A+2crGW09Vu3NdfxzdouZSUI9tQ= Injection-Date: Thu, 28 Mar 2019 10:00:15 -0000 User-Agent: flnews/0.16 (for NetBSD) X-Received-Bytes: 6135 X-Received-Body-CRC: 1080262575