Test: added benign SQL and script regression tests with narrow payload fix - #133
Test: added benign SQL and script regression tests with narrow payload fix#133aaishii07 wants to merge 7 commits into
Conversation
|
hey @aaishii07, please add tests showing actual SQLi/XSS payloads with conversational framing still score correctly, for example: natural language + UNION SELECT payloads otherwise its quite hard to verify this didnt unintentionally weaken the payload signal logic while reducing false positives. |
|
also a few concerns:
|
|
Hi @Wahid7852 ! I've addressed all the concerns:
|
|
Good effort. Once the merge conflicts are resolved and the _EXECUTABLE_SCRIPT_RE bypass is tightened up this will be in a good shape to merge. |
…on logic in one file, fixed executable script detection, made threshold consistent
|
@Wahid7852 I have resolved all the concerns. If any more do rise up, please let me know! |
Wahid7852
left a comment
There was a problem hiding this comment.
everything else looks good, merge the conflicts and should be ready to merge.
cc @0-Shimanshu, check it out once
|
@aaishii07 conflict |
Signed-off-by: Aaishi Gupta <guptaaaishi@gmail.com>
|
@aaishii07 will close this if no activity within 4-5 days |
Summary
Added two regression tests for harmless discussion-style SQL and HTML text that was being incorrectly flagged as hostile. Added a narrow fix to the payload signal to prevent false positives on these cases.
Why
The payload signal was scoring sentences like "How do I write SELECT * FROM users in a tutorial?" at 0.72, treating natural language discussion as SQL injection. Same for <script>.
Scope
Verification
pytest tests/test_benign_matrix.py -v
pytest --ignore=tests/test_cli.py -q
Notes:
Signal-specific notes
trackB)Source: select_from pattern and vendor detect_xss were triggering on discussion text.
Benign case checked: "How do I write SELECT * FROM users in a tutorial?" → 0.0, "How do I print <script> literally in docs?" → 0.0
TUI notes
Local-only file check
adiuvare.yamlor localconftest.pychangesRelated issue
Closes #6