Skip to content

Conversation

Zabuzard
Copy link
Member

@Zabuzard Zabuzard commented Feb 26, 2025

Our Scam Detector recently ran into its first false positive, a message like this:

https://learn.microsoft.com/en-us/dotnet/csharp/fundamentali/types/anonymous-typesd

The reason it was flagged is because it has the word learn in it, which contains("earn"), one of our suspicious keywords.

This PR adds unit tests to cover false positives and fixes the above issue by allowing suspicious keywords to require a startsWith check instead of contains by starting with ^. So ^earn will not trigger on learn anymore.

Note, the logic for this was self-written. It would also be possible to make them a full regex pattern (which supports ^ as well), but I thought this would be a bit overkill and also annoying, since all other keywords would then need to be changed to .*foo.*.

Config

When deploying, change the suspicious keyword earn in the config to ^earn.

@Zabuzard Zabuzard added enhancement New feature or request priority: normal config-changes if your PR contains any changes related to config file labels Feb 26, 2025
@Zabuzard Zabuzard self-assigned this Feb 26, 2025
@Zabuzard Zabuzard requested a review from a team as a code owner February 26, 2025 08:07
Copy link

@Zabuzard Zabuzard merged commit 07e0fe5 into develop Mar 3, 2025
11 checks passed
@Zabuzard Zabuzard deleted the feature/scam_detector_false_positive branch March 3, 2025 07:34
@Zabuzard Zabuzard mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config-changes if your PR contains any changes related to config file enhancement New feature or request priority: normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants