Reduce false positives in credential and prompt injection scanners#67
Merged
Conversation
Credential scanner (#65): add Rust test file patterns (_tests.rs, _test.rs), dummy/fake/example filename detection to test context. Files matching these patterns get severity downgraded to LOW. Prompt injection scanner (#66): remove 'run' from HTML comment injection keywords (too common in file paths), add word boundaries to remaining keywords. Prevents CJK documentation from triggering. Signed-off-by: debu-sinha <debusinha2009@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #65, closes #66
What changed
Credential scanner (#65): Expanded
_is_test_or_doc_contextto detect:*_tests.rs,*_test.rs)dummy*,fake*)example*,sample*)Files matching these patterns get severity downgraded from CRITICAL/HIGH to LOW.
Prompt injection scanner (#66): Fixed hidden instruction HTML comment pattern:
runkeyword (too common in file paths like/commands/run.ts)\bword boundaries to remaining keywordsTesting
Pattern tests verified:
<!-- 证据来源:packages/cli/src/commands/site.ts -->: NOT matched (correct)<!-- ignore all previous instructions -->: matched (correct)Expected impact on MCP dashboard: reduces critical/high FP rate from 59% to ~18%.