🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87987

Re: Cleanfeed bad_body woes

#87987
From: Steve Crook
Date: Thu, 11 Jul 2019 21:43
49 lines
2650 bytes
On Thu, 11 Jul 2019 01:29:57 -0700, Retro Guy wrote in
Message-Id: <20190711012957.46e76b50@desktop14.dt>:

> On Wed, 10 Jul 2019 17:26:44 -0600
> Grant Taylor <gtaylor@tnetconsulting.net> wrote:
>
>> Hi,
>> 
>> I need some help with cleanfeed (337) not filtering (blocking
>> messages) out some body content.
>> 
>> ...
>> 
>> I did some sleuthing and it seems as if Bad_Body(_RE) is only tested
>> if there is not a References: header, which the messages I'm trying
>> to filter do have.  (I think it's a bogus References: header, likely
>> meant to bypass cleanfeed.)
>> 
>> Does anybody know if this is in fact the case?  Does a References: 
>> header avoid bad_body checks?
>
> Looking in filter_innd.pl:
>
>         # Check payload against bad_body and bad_url files.
>         if (not $gr{reports} and not $hdr{References}) {
>             return reject("Body ($1)", 'Bad Body')
>                if $Bad_Body and $body =~ $Bad_Body_RE;
>         };
>
> so it looks like if there is a References header, bad_body won't be
> checked.
Yes, that's correct.  There is no clear-cut answer to whitelisting
messages with References:  Without the References check, it's likely
that a large chunk of a thread will be filtered out because it quotes
the content that triggered the filter.  With the References check, it's
easy for a malicious poster to circumvent the check just by adding a
bogus References header.

> I do body checks in cleanfeed.local in 'sub local_filter_last' and it's
> working well for me. (checking $hdr{__BODY__}) Maybe that's not the
> right way or place to do it, but it does work.
This is probably the best way to enforce local policies.

-- 
What shall we use 
To fill the empty spaces 
Where we used to talk?

Technical Details
Message-ID: <slrnqifbcj.u39.steve@fleegle.mixmin.net>
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: <qg5s8m$cvi$1@tncsrv09.home.tnetconsulting.net> <20190711012957.46e76b50@desktop14.dt>

Show Full Headers
Complete Article Headers
Message-ID: <slrnqifbcj.u39.steve@fleegle.mixmin.net>
Subject: Re: Cleanfeed bad_body woes
Date: Thu, 11 Jul 2019 21:43:47 +0000
From: Steve Crook <steve@mixmin.net>
References: <qg5s8m$cvi$1@tncsrv09.home.tnetconsulting.net> <20190711012957.46e76b50@desktop14.dt>
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
Organization: Mixmin
Injection-Date: Thu, 11 Jul 2019 21:43:47 -0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="c4af4a3027e8317d29ea238d8aa6bb2f616aa3fc";
 logging-data="1526"; mail-complaints-to="abuse@mixmin.net"
User-Agent: slrn/pre1.0.4-2 (Linux)
X-Received-Bytes: 2655
X-Received-Body-CRC: 970743350