Skip to content

fix(scan): normalize separators before prompt-injection matching #110

Closed

Description

@mrgoonie

Problem

The prompt-injection rules in the content scanner (content-scanner.ts, used by release scanning) match on raw text. Separators that readers render as spacing or drop entirely slip past them:

  • U+0085 (NEL) is not matched by JS \s.
  • U+00AD (soft hyphen) is not in INVISIBLE_UNICODE, so Ig\u00ADnore all previous instructions in a valid UTF-8 SKILL.md is published.
  • In lossy UTF-8 decodes, single invalid bytes (0x85, 0x93, 0x96, 0x9D, 0xFF after \t) become U+FFFD, which is neither whitespace nor a word character.

Suggested fix

Normalize text before running the injection regexes: strip U+00AD and other default-ignorable code points, and treat U+0085 and U+FFFD as whitespace. Add tests for each separator.

Pre-existing (not a regression). Found during isolated review of #96.

Activity

  1. self-assigned this
    on Oct 20, 2026
  2. added
    donePR opened
    and removed on Oct 20, 2026
  3. added
    shippedMerged/deployed
    and removed
    donePR opened
    on Oct 20, 2026
  4. added a commit that references this issue on Oct 20, 2026
    17fca38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-handleFound during automated runshippedMerged/deployed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions