fix(#1615): allowlist windsurf-conversion.test.cjs in prompt-injection-scan

The commandName validation tests legitimately contain real injection payloads (newline + system-role override phrases, fake [SYSTEM] tags, jailbreak strings) to prove the validator rejects them. The scanner cannot distinguish a test fixture asserting rejection from an actual injection attempt, so CI failed on the test that adds the security control.

Added tests/windsurf-conversion.test.cjs to scripts/prompt-injection-scan.sh ALLOWLIST with a comment citing the defect class.

Also added DEFECT.PROMPT-INJECTION-SCAN-COLLISION-WITH-TESTS to CONTEXT.md so the pattern is documented. Initial draft of that predicate ITSELF triggered the scanner (it quoted the literal injection phrase as an example) — reworded to use descriptive references ('scanner-matching payload', 'instruction-override phrase') since the scanner scans CONTEXT.md too. That meta-collision is now called out in the fix-forward and prevention subkeys.
This commit is contained in:
Tom Boucher
2026-06-23 15:05:07 -04:00
parent 481ca1b18e
commit c63fa35b0a
2 changed files with 10 additions and 0 deletions

View File

@@ -85,6 +85,10 @@ ALLOWLIST=(
# and are not attack vectors — they explain/demonstrate injection patterns.
'TEST-EXAMPLES.md'
'explanation/security-model.md'
# Security regression tests for input validators — fixtures must contain
# real injection payloads to prove the validator rejects them. See
# DEFECT.PROMPT-INJECTION-SCAN-COLLISION in CONTEXT.md.
'tests/windsurf-conversion.test.cjs'
)
is_allowlisted() {