安全漏洞 / 高 / Agent 引擎
electron/harness/security/prompt-injection-defense.ts
攻击者可使用 Unicode 同形字符(homoglyph)绕过关键词检测:
іgnore
іgnorе
ignore\u200bprevious
ignore\u00adprevious
这些字符在视觉上与原文无异,但正则匹配会失败。
const normalized = input.normalize('NFKC'); // 移除零宽字符 const cleaned = normalized.replace(/[\u200b\u200c\u200d\u00ad\ufeff]/g, ''); // 然后检测
No dependencies set.
The note is not visible to the blocked user.
问题类型
安全漏洞 / 高 / Agent 引擎
文件位置
electron/harness/security/prompt-injection-defense.ts问题描述
攻击者可使用 Unicode 同形字符(homoglyph)绕过关键词检测:
іgnore(使用西里尔字母 і 替换 i)іgnorе(混用拉丁、西里尔、希腊字母)ignore\u200bprevious(零宽空格分隔)ignore\u00adprevious(软连字符)这些字符在视觉上与原文无异,但正则匹配会失败。
影响
建议修复