🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
9 messages
9 total messages Started by Steve Walker Sat, 29 Apr 2000 00:00
null characters
#46199
Author: Steve Walker
Date: Sat, 29 Apr 2000 00:00
17 lines
984 bytes
Hello everyone,

I was wondering does the NNTP protocol allow null characters to be
embedded in articles?  If so, does anyone see a problem with striping
them? 

I finally tracked down a problem with earthquake getting out of sync
while accepting a feed.  It seems some of my news peers are sending
null characters which cause problems with string functions like
strcmp.

Thanks,
Steve.
http://nntprouter.nibble.net


Re: null characters
#46166
Author: Jonathan Grobe
Date: Sat, 29 Apr 2000 00:00
29 lines
1898 bytes
In article <FtrtDB.H75@spcuna.spc.edu>, Terry Kennedy wrote:
>Steve Walker <mouse@nospam.nibble.net> writes:
>> I was wondering does the NNTP protocol allow null characters to be
>> embedded in articles?  If so, does anyone see a problem with striping
>> them? 
>
>  They seem to come from a small number of hosts - of 1015 articles 
>with NULs in them, there were 28 different hosts, with 704 of the
>articles from a single host.
>
>  Think of dropping the articles as "doing your bit to help enforce
>correct behavior".
>
The majority of the time when someone does incorrect behavior in
these types of situations is because they are doing it accidently and
don't know they are doing it.

A  better approach would be for you to post the sites with the number
of articles. It is possible someone might be willing to contact these
sites and see if any particular software is responsible. Fixing the
software is a better solution than just dropping the articles.

-- 
Jonathan Grobe      Jonathan Grobe Books. Used & out-of-print books:
Search or browse subject catalogs: <http://www.netins.net/showcase/grobe>
For millions of used/out-of-print books try <http://www.abebooks.com>
<http://www.bibliofind.com> <http://www.bookavenue.com> 

Re: null characters
#46167
Author: Andrew Gierth
Date: Sat, 29 Apr 2000 00:00
18 lines
1314 bytes
>>>>> "Steve" == Steve Walker <mouse@NOSPAM.nibble.net> writes:

 Steve> Hello everyone,
 Steve> I was wondering does the NNTP protocol allow null characters
 Steve> to be embedded in articles?

Existing standards don't really specify. The USEFOR draft forbids
them. Lots of existing software doesn't like them.

 Steve> If so, does anyone see a problem with striping them?

Yes. If you can't handle them, then reject the article rather than
modify it.

-- 
Andrew.

Re: null characters
#46172
Author: Russ Allbery
Date: Sat, 29 Apr 2000 00:00
15 lines
1110 bytes
Steve Walker <mouse@NOSPAM.nibble.net> writes:

> I was wondering does the NNTP protocol allow null characters to be
> embedded in articles?  If so, does anyone see a problem with striping
> them?

Yeah, you don't ever want to modify articles in transit.

Current versions of INN reject all articles containing embedded nuls
because INN can't handle them (yet).

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

Re: null characters
#46175
Author: Russ Allbery
Date: Sat, 29 Apr 2000 00:00
33 lines
2062 bytes
Curt Welch <curt@kcwc.com> writes:

> And your code which parses the NNTP stream needs to be able to deal with
> nulls because there are lots of articles which have them today.  I cross
> post all articles with nulls in them to local.nulls and the group
> currently contains 16000 articles (for a 2wk period).

Most of them, however (at least the last time I checked) are either spam
or badly mangled binaries, although a few people's news clients do seem
capable of producing them and occasionally I have to strip them out of
articles when I approve them for groups that I moderate.

> In my opinion, an NNTP tranist server should be able to receive, and
> re-transmit any article without changing it at all (other than the Path:
> header and an optional Xref: header).

Agreed.

However, be aware that C News will have *serious* problems with articles
with embedded nuls, so if you're feeding any C News sites, you do need to
be careful to not feed them those articles.

> There are newsreaders which uuencode data without doing the leading DOT
> encoding like it should.

The fact that a newsreader was able to post such an article to Usenet
indicates that its local news server has a serious bug.  Such articles
*definitely* should be rejected on POST.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

Re: null characters
#46176
Author: Terry Kennedy
Date: Sat, 29 Apr 2000 00:00
24 lines
1966 bytes
Jonathan Grobe <grobe+news@netins.net> writes:
> A  better approach would be for you to post the sites with the number
> of articles. It is possible someone might be willing to contact these
> sites and see if any particular software is responsible. Fixing the
> software is a better solution than just dropping the articles.

  Sorry, I've fallen into the "I used to be disgusted, now I'm just amused"
category as far as Usenet software goes.

  However, when there were problems (like when one of my newspeers did an
incomplete job of converting their spool to "wire format" and put a NUL in
*every* article), I did let them know. But I see no redemming value in the
spam that made up the bulk of the NULlish articles I used to see here be-
fore I started dropping them, and telling them "folks are missing your 
pearls of wisdom, you should fix your software" is counter-productive.

  And lastly, since I drop the articles these days, all I have are the
Message-ID's, so getting back to the original poster is problematic.

	Terry Kennedy             http://www.tmk.com
        terry@tmk.com             Jersey City, NJ USA


Re: null characters
#46190
Author: Curt Welch
Date: Sat, 29 Apr 2000 00:00
72 lines
4474 bytes
mouse@NOSPAM.nibble.net (Steve Walker) wrote:
> Hello everyone,
>
> I was wondering does the NNTP protocol allow null characters to be
> embedded in articles?

Sure.  But the real question is whether USEFOR and the other article
format RFCs say it's ok.

> If so, does anyone see a problem with striping
> them?

Never modify the article like that.  Either deal with it, or reject it.
There are people who believe articles should be allowed to conatin nulls
(in the body at least).  One day that might be "valid" and you don't want
your server corrupting them as they pass by.

And your code which parses the NNTP stream needs to be able to deal with
nulls because there are lots of articles which have them today.  I cross
post all articles with nulls in them to local.nulls and the group currently
contains 16000 articles (for a 2wk period).

> I finally tracked down a problem with earthquake getting out of sync
> while accepting a feed.  It seems some of my news peers are sending
> null characters which cause problems with string functions like
> strcmp.

I took great pains to make sure all my header and article parsing code
could deal with nulls (and all 8-bit data).  I don't use C-style strings to
store any of the raw article information and I don't use functions like
strcmp until the data has been extracted from the headers and is known not
to contain nulls.

In my opinion, an NNTP tranist server should be able to receive, and
re-transmit any article without changing it at all (other than the Path:
header and an optional Xref: header).  If it decides to reject certain
articles after they are received because they don't meet certain standards,
that's fine, but if it decides to re-transmit the article to a peer, then
it MUST do it without changing a single byte.  So from this point of view,
on the NNTP data stream, an article is either 0 bytes terminated with DOT
CR LF, or 1 or more 8 bit bytes terminated with CR LF DOT CR LF.  And when
that article is re-transmitted, it should be byte-for-byte identical to how
it was received.  That includes all possible 8 bit values including NULLs
and CRs or LFs in any combination.  So an article that contains CR LF LF LF
CR CR CR CR LF CR etc. should be re-transmitted byte for byte exactly like
it was received.  Header lines should not be "cleaned up" or reformated in
any way, etc.

And, an article that contains an invalid single leading DOT on a line
should also be re-transmitted exactly like it was received, or it should be
rejected. Do NOT strip leading dots off the lines on incomming articles
without checking to make sure the next character on the line is a DOT as
well.  New articles being POSTED to the server should always be checked for
this bug and should be rejected if it's detected.

There are newsreaders which uuencode data without doing the leading DOT
encoding like it should.  But the last data line of a uuencoded file can
begin with a DOT if the file length happens to be correct.  But it might
also just happen to begin with multiple dots instead of only one.

There are other newsreaders/decoding programs which look for this bug and
try to correct for it -- but if your transit server starts stripping off
leading dots and not putting them back on as it passes though, then
that makes things even worse.  It's bad enough that the article was
allowed onto Usenet by the first newsreader/news server, but it causes
even more problems if it gets modified even further with each hop.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Re: null characters
#46193
Author: Terry Kennedy
Date: Sat, 29 Apr 2000 00:00
20 lines
1466 bytes
Steve Walker <mouse@nospam.nibble.net> writes:
> I was wondering does the NNTP protocol allow null characters to be
> embedded in articles?  If so, does anyone see a problem with striping
> them? 

  There's enough servers that can't deal with this that I just drop
the offending articles - they don't even make it to spool on the local
news server.

  They seem to come from a small number of hosts - of 1015 articles 
with NULs in them, there were 28 different hosts, with 704 of the
articles from a single host.

  Think of dropping the articles as "doing your bit to help enforce
correct behavior".

	Terry Kennedy             http://www.tmk.com
        terry@tmk.com             Jersey City, NJ USA

Re: null characters
#46202
Author: Curt Welch
Date: Sun, 30 Apr 2000 00:00
36 lines
2696 bytes
Russ Allbery <rra@stanford.edu> wrote:
> Curt Welch <curt@kcwc.com> writes:
>
> > And your code which parses the NNTP stream needs to be able to deal
> > with nulls because there are lots of articles which have them today.  I
> > cross post all articles with nulls in them to local.nulls and the group
> > currently contains 16000 articles (for a 2wk period).
>
> Most of them, however (at least the last time I checked) are either spam
> or badly mangled binaries, although a few people's news clients do seem
> capable of producing them and occasionally I have to strip them out of
> articles when I approve them for groups that I moderate.

Yeah, I just scanned though a lot of them and couldn't find a single one
worth keeping.  Every one I looked at was spam.  Some seem to be binaries
that were posted in-line without being encoded.  Others looked like they
were just generated by poorly written clients which made other mistakes as
well (like ending lines with CR CR LF).

No one would miss them if you just dropped them (though I personally like
having them in the spool so I can can examine them to see what the problem
is and where it's comming from).  About half of them seemed to be comming
from WebUseNet Corp http://www.usenetserver.com. Looks like their web
interface must have some type of file attach function meant for loading
text into the body of the article that some spammer is using to attach
poorly formated spam postings which end up with both the end of line
markers wrong and a line of NULLs at the end of the article right after the
UUENCODE "end" line. One such example is:

 <DIiO4.14197$Nd6.2445968@news-west.usenetserver.com>

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

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