🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
3 messages
3 total messages Started by Grant Taylor Wed, 10 Jul 2019 23:26
Cleanfeed bad_body woes
#87984
Author: Grant Taylor
Date: Wed, 10 Jul 2019 23:26
31 lines
2014 bytes
Hi,

I need some help with cleanfeed (337) not filtering (blocking messages) 
out some body content.

I originally wondered if bad_body wasn't matching or if I had problems 
with cleanfeed not being refreshed.

But, cleanfeed.stats is showing all of the strings in the bad_* files 
after doing "ctlinnd reload filter.perl 'spam'", and all testing looking 
for specific strings seemed to be filtered properly.

Yet I still have messages with body content making it through.

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?

Or is there something else going on?



-- 
Grant. . . .
unix || die

Re: Cleanfeed bad_body woes
#87986
Author: Retro Guy
Date: Thu, 11 Jul 2019 08:29
41 lines
2097 bytes
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.

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.

Retro Guy

-- 
Posted via novabbs



Re: Cleanfeed bad_body woes
#87987
Author: 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?

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