Repository navigation
fix(scan): normalize separators before prompt-injection matching - #111
Merged
Merged
Conversation
Readers drop default-ignorable code points (soft hyphen, zero-width and bidi controls) and render U+0085 and U+FFFD as breaks, so an injection split by them slipped past the raw-text regexes. The injection rules now run on the text with those separators spaced out and with ignorables both stripped and spaced. Closes #110 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LzvgR3j15o75z1c1acWjYy
Hangul fillers are default-ignorable yet drawn as a blank, so a filler between words combined with a soft hyphen inside a word defeated both the stripped and the spaced candidate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LzvgR3j15o75z1c1acWjYy
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 #110
Summary
The prompt-injection rules in
content-scanner.ts(used by release scanning, GitHub import and skill detail) matched raw text, so separators that readers drop or render as spacing let an injection through. They now run on normalized candidates:\p{Default_Ignorable_Code_Point}(soft hyphen, zero-width and bidi controls, CGJ…) is checked both stripped (Ignore) and spaced (ignoreall).Only the injection rules see the normalized text; findings, other rules and
sanitizeContent(stored content) are unchanged.Verification
SKILL.mdwith a soft hyphen or NEL injection is quarantined.pnpm test: 111 files, 2217 passed / 2 skipped (before the filler follow-up); scanner + release-scan suites 50/50 after it.pnpm typecheck: clean.\p{…}/uis ES2018 and the repo targets ES2022 / Workers V8; 1.2M-char input scans in ~62 ms.Docs
docs/code-standards.mdanddocs/api-reference.md(release scan) describe the normalization.Generated by Claude Code