Mailing List Archive

KAM_SOMETLD_ARE_BAD_TLD false positive
My cellular supplier has a weekly bag of goodies (coupons, schwag) and last
week's included a free photo refrigerator magnet from CVS. So I signed up a
CVS/Kodak account to put in my order. Like most such offers, they start
sending me marketing mail, and the first one hit KAM_SOMETLD_ARE_BAD_TLD,
with a 5.0 score. I'll be turning that score down (probably to 3.5) but I
think the rule itself is the issue. It's firing on a uri that has dot shop
as the last part of the path in a legitimate dotcom uri. Perhaps the rule
can check for the absence of a single slash before the offending TLD.
There's a helper rule that checks for false positives that could be
replaced with one that ignores TLDs after an isolated slash in a uri.

Do the KAM rules have an issue tracker where this kind of report can be
made?

The rule:

header __KAM_SOMETLD_ARE_BAD_TLD_FROM From:addr =~
/\.(pw|stream|trade|press|top|date|guru|casa|online|cam|shop|club|b
uri __KAM_SOMETLD_ARE_BAD_TLD_URI
/\.(pw|stream|trade|press|top|date|guru|casa|online|cam|shop|club|bar)($|\/)/i

#FPs
uri __KAM_SOMETLD_ARE_BAD_TLD_URI_NEGATIVE
/(^|\b)td\.date|div\.top($|\/)/i

meta KAM_SOMETLD_ARE_BAD_TLD (__KAM_SOMETLD_ARE_BAD_TLD_FROM) ||
(__KAM_SOMETLD_ARE_BAD_TLD_URI && !__KAM_SOMETLD_ARE_BAD_TLD
describe KAM_SOMETLD_ARE_BAD_TLD .stream, .trade, .pw, .top,
.press, .guru, .casa, .online, .cam, .shop, .bar, .club & .d
score KAM_SOMETLD_ARE_BAD_TLD 5.0
Re: KAM_SOMETLD_ARE_BAD_TLD false positive [ In reply to ]
Kenneth Porter wrote:
>
> uri      __KAM_SOMETLD_ARE_BAD_TLD_URI
> /\.(pw|stream|trade|press|top|date|guru|casa|online|cam|shop|club|bar)($|\/)/i
>

I have a client whose NVR writes its archived video spools to a .cam
folder on their server.  Heaven forbid ".well-known" ever becomes a TLD :)

*Maybe* a little more refinement could prevent it picking  up .hidden
folders that have a BAD_TLD name.

/[A-z0-9]+\.(pw|stream|trade|press|top|date|guru|casa|online|cam|shop|club|bar)(\s|$|\/)/i


$0.02,

-- Jared Hall
Re: KAM_SOMETLD_ARE_BAD_TLD false positive [ In reply to ]
On 8/11/2021 7:39 AM, Jared Hall wrote:
>
> *Maybe* a little more refinement could prevent it picking  up .hidden
> folders that have a BAD_TLD name.
>
> /[A-z0-9]+\.(pw|stream|trade|press|top|date|guru|casa|online|cam|shop|club|bar)(\s|$|\/)/i


The CVS/Kodak uri would still fail on this pattern, as the BAD_TLD is
the extension in the final path component.

My initial idea for fixing this in the negative pattern wouldn't work
because a spammer could use https://example.badtld/example.badtld to
sneak through.

Perhaps something like
"//[^/]+\.(pw|stream|trade|press|top|date|guru|casa|online|cam|shop|club|bar)($|/)"i
?

That might also need a matcher on the end for the optional port number.

BTW, does SA permit use of Perl-style regex delimiters to avoid leaning
toothpick syndrome?

https://en.wikipedia.org/wiki/Leaning_toothpick_syndrome