fix(exec): escape invisible approval filler chars

This commit is contained in:
Peter Steinberger
2026-03-22 22:51:00 -07:00
parent 78175aeb0a
commit 4d50084c6e
6 changed files with 54 additions and 3 deletions

View File

@@ -8,6 +8,12 @@ describe("sanitizeExecApprovalDisplayText", () => {
it("escapes unicode format characters but leaves other text intact", () => {
expect(sanitizeExecApprovalDisplayText("echo hi\u200Bthere")).toBe("echo hi\\u{200B}there");
});
it("escapes visually blank hangul filler characters used for spoofing", () => {
expect(sanitizeExecApprovalDisplayText("date\u3164\uFFA0\u115F\u1160가")).toBe(
"date\\u{3164}\\u{FFA0}\\u{115F}\\u{1160}가",
);
});
});
describe("resolveExecApprovalCommandDisplay", () => {