diff --git a/actions/setup/js/sanitize_content.test.cjs b/actions/setup/js/sanitize_content.test.cjs index 8c383588624..f9bd765dbcb 100644 --- a/actions/setup/js/sanitize_content.test.cjs +++ b/actions/setup/js/sanitize_content.test.cjs @@ -1663,6 +1663,51 @@ describe("sanitize_content.cjs", () => { const result = sanitizeContent("@author is allowed", { allowedAliases: ["author"] }); expect(result).toBe("@author is allowed"); }); + + it("should decode > entity to > to prevent literal > in output", () => { + const result = sanitizeContent("value > threshold"); + expect(result).toBe("value > threshold"); + }); + + it("should decode double-encoded &gt; entity to >", () => { + const result = sanitizeContent("value &gt; threshold"); + expect(result).toBe("value > threshold"); + }); + + it("should decode < entity to < and then neutralize resulting tags", () => { + const result = sanitizeContent("<script> injection"); + // < → < and > → >, then convertXmlTags turns