Article View: news.software.nntp
Article #88323Re: Cleanfeed question
From: Retro Guy Retro Guy
Date: Fri, 03 Apr 2020 22:50
Date: Fri, 03 Apr 2020 22:50
56 lines
3157 bytes
3157 bytes
admin@invalid.usenet.ee wrote:
> Hello!
> Cleanfeed body check is conditional, depending message *not* having
> References: https://github.com/crooks/cleanfeed/blob/master/cleanfeed#L1227
> Looking into history it seems to be this way long time, possibly import
> from cleanfeed.local.
> Can anyone give idea, why this exception was made?
This was asked a few months ago, here's the comments from that thread. (credit to steve@mixmin.net)
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.
Technical Details
Message-ID:
<374c989ecaee03070db866dd2b127174$1@news.novabbs.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<r67ct4$23cm$1@news.usenet.ee>Show Full Headers
Complete Article Headers
Message-ID: <374c989ecaee03070db866dd2b127174$1@news.novabbs.com> Subject: Re: Cleanfeed question Date: Fri, 03 Apr 2020 22:50:01 +0000 From: Retro Guy@rslight.i2p (Retro Guy) References: <r67ct4$23cm$1@news.usenet.ee> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: news.software.nntp Organization: Rocksolid Light Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 3 Apr 2020 22:50:01 -0000 (UTC) Injection-Info: i2pn2.org; posting-account="retrobbs1"; logging-data="444"; mail-complaints-to="usenet@i2pn2.org" User-Agent: Rocksolid Light (news.novabbs.com/getrslight) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs.com X-Rslight-Site: $2y$10$6F4PH5kQo6DU5ReA1i7Z4u5Dg.RqQRQ0MGbHV0vuE6zDl8HjilKMq Lines: 56