From 644e0bfa5d606618973fa3b205b7b4cfa98762f3 Mon Sep 17 00:00:00 2001
From: Eduard Arbona <175124143+earbona23@users.noreply.github.com>
Date: Sat, 7 Nov 2026 16:41:28 -0400
Subject: [PATCH 1/5] fix: Get-MtSafeMarkdown now escapes GFM autolink literals
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
A tenant-controlled name still rendered as a live link after the helper ran,
because the report renders with `gfm: true` (report/src/components/Markdown.tsx:11)
and GFM autolinks text that is not markdown syntax at all. Raised by @Dfrank77
on #2711, from a CodeRabbit note on #2710.
Measured against the report's own stack — this file dot-sourced, then
marked@18.1.3 with `gfm: true`, then DOMPurify as Markdown.tsx:32 calls it:
input before after
Sign in at https://phish.example/login text
Sign in at http://phish.example/login text
Get it at ftp://phish.example/x text
Sign in at www.phish.example/login text
Contact admin@phish.example text
Write to mailto:admin@phish.example text
Sign in [aqui](https://phish.example) text
The last row is worth naming: the helper already neutralised the markdown link,
but the URL it left behind was autolinked anyway, so the payload was downgraded
rather than removed. DOMPurify does not catch any of this; it keeps https
anchors by design (control: the same call strips