Skip to content

Static analyzers flag emoji-zwj-sequence as Prompt InjectionΒ #259

Description

@badnoodle

Version: v2.3.11, repo HEAD c2d09df, static mode (--no-llm), running via the command line.

Observation: scan such as SKILL.md which contains emoji

Example:

  1. Part of the content in SKILL.md: πŸ§‘β€βš–οΈ
  2. The unicode sequence is: ['U+1F9D1', 'U+200D', 'U+2696', 'U+FE0F']
  3. The scan result: { "id": "P2", "category": "Prompt Injection", "pattern": "Hidden Instructions", "severity": "HIGH", "confidence": 0.6, "location": { "file": "SKILL.md", "start_line": 147, "end_line": null }, "finding": **"\u200d"**}

Analyze:

  1. the SKILL.md will match pattern (r"[\u200b\u200c\u200d\u2060\ufeff]", 0.6) in P2_PATTERNS
  2. the matched \u200d which is part of emoji-zwj-sequence, (1F9D1 200D 2696 FE0F ; RGI_Emoji_ZWJ_Sequence ; judge) see detail in https://unicode.org/Public/emoji/16.0/emoji-zwj-sequences.txt, which is false positive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions