diff --git a/.changeset/editor-bug-hunt-batch.md b/.changeset/editor-bug-hunt-batch.md new file mode 100644 index 00000000..c28163a0 --- /dev/null +++ b/.changeset/editor-bug-hunt-batch.md @@ -0,0 +1,17 @@ +--- +"@templatical/core": patch +"@templatical/editor": patch +--- + +Batch of bug fixes hardening editor correctness and security: + +- **Link dialog rejects dangerous URL schemes.** `javascript:`, `data:`, `vbscript:`, `file:` (plus case-bypasses like `JaVaScRiPt:` and whitespace-padded variants) are now dropped at link-insert time. Safe schemes (`http`, `https`, `mailto`, `tel`, `ftp`, `ftps`, `sms`, `xmpp`, `cid`) and `#` anchors still pass through. +- **`v-html` content sanitized before render.** `ParagraphBlock` and `TitleBlock` now scrub `
after
', + styles: {}, + } as any, + viewport: "desktop", + }, + global: { provide: baseProvide() }, + }); + + const html = wrapper.html(); + expect(html).not.toContain("World
", + ); + expect(result).not.toContain("">', + ); + expect(result).not.toContain("data:text/html"); + }); + + it("keeps data:image/* src intact", () => { + const result = sanitizeRichTextHtml( + '