Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve query safety by using regex for keyword detection and fix exclude benign phrases from malicious keyword detection (e.g. "through osmosis") #1306

Merged

Conversation

N1ghtmarecus
Copy link
Contributor

This PR addresses a critical issue in the check_malicious_keywords_in_query function where safe expressions such as through osmosis and the ionosphere were incorrectly flagged as containing malicious keywords. The function has been updated to more accurately detect and filter only truly dangerous queries.

Additionally, while the English language doesn't have many common words that start with 'os', in other languages, like Polish, this is not the case. For instance, the word ostatni, which means last in English, is a very common word that was incorrectly flagged by the previous implementation. This PR ensures that such false positives are now avoided, enhancing the function's reliability across different languages.

…lude benign phrases from malicious keyword detection (e.g. "through osmosis")
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 1, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 13, 2024
@ArslanSaleem ArslanSaleem merged commit e15281b into sinaptik-ai:main Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants