NousResearch/hermes-agent

Kanban dashboard XSS via unsanitized markdown HTML

Cluster 31934 · dashboard. Data as of

Nothing open on GitHub. Fix merged in #50392 on 21 Jun 2026. Check it covers your case.

The short answer

0open issues
0open PRs
3items grouped
Known?
Yes. 3 related items grouped here, 1 issue already closed.
Fix event
A fix was merged to main in PR #50392. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this resolved, deciding PR #50392. That is separate from the fix event.
Still open
Nothing open on GitHub.

These items address a cross-site scripting vulnerability in the Kanban dashboard where markdown is rendered as HTML without sanitization. The work involves sanitizing HTML at the render sink to prevent injection attacks.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #50392 fix(security): sanitize Kanban dashboard markdown HTML at the render sink

    merged to main

    files: plugins/kanban/dashboard/dist/index.js, tests/plugins/test_kanban_dashboard_plugin.py

    Show the diff
    • plugins/kanban/dashboard/dist/index.js
      @@ -334,6 +334,48 @@
           );
           return html;
         }
      +  const MARKDOWN_ALLOWED_TAGS = new Set([
      +    "a",
      +    "code",
      +    "em",
      +    "h1",
      +    "h2",
      +    "h3",
      +    "h4",
      +    "li",
      +    "p",
      +    "pre",
      +    "strong",
      +    "ul",
      +  ]);
      +  function escapeAttribute(value) {
      +    return escapeHtml(value).replace(/`/g, "`");
      +  }
      +  function sanitizeMarkdownAttrs(tag, attrs) {
      +    if (tag === "a") {
      +      const hrefMatch =
      +        /\shref=(["'])(.*?)\1/i.exec(attrs) ||
      +        /\shref=([^\s>]+)/i.exec(attrs);
      +      const href = hrefMatch ? (hrefMatch[2] || hrefMatch[1] || "").trim() : "";
      +      if (!/^(https?:\/\/|mailto:)/i.test(href)) return "";
      +      return ` href="${escapeAttribute(href)}" target="_blank" rel="noopener noreferrer"`;
      +    }
      +    if (tag === "pre" && /\sclass=(["'])hermes-kanban-md-code\1/i.test(attrs)) {
      +      return ' class="hermes-kanban-md-code"';
      +    }
      +    return "";
      +  }
      +  function sanitizeMarkdownHtml(html) {
      +    return String(html || "").replace(
      +      /<\/?([a-zA-Z][A-Za-z0-9-]*)([^>]*)>/g,
      +      (match, rawTag, attrs) => {
      +        const tag = rawTag.toLowerCase();
      +        if (!MARKDOWN_ALLOWED_TAGS.has(tag)) return "";
      +        if (/^<\s*\//.test(match)) return `</${tag}>`;
      +        return `<${tag}${sanitizeMarkdownAttrs(tag, attrs || "")}>`;
      +      },
      +    );
      +  }
       
         function MarkdownBlock(props) {
           const enabled = props.enabled !== false;
      @@ -342,7 +384,7 @@
           }
           return h("div", {
             className: "hermes-kanban-md",
      -      dangerouslySetInnerHTML: { __html: renderMarkdown(props.source || "") },
      +      dangerouslySetInnerHTML: { __html: sanitizeMarkdownHtml(renderMarkdown(props.source || "")) },
           });
         }
       
    • tests/plugins/test_kanban_dashboard_plugin.py
      @@ -247,6 +247,19 @@ def test_dashboard_initial_board_uses_backend_current_when_unpinned():
           assert 'readSelectedBoard() || "default"' not in js
       
       
      +def test_dashboard_markdown_html_is_sanitized_before_render():
      +    """Markdown rendering must sanitize HTML before dangerouslySetInnerHTML."""
      +
      +    repo_root = Path(__file__).resolve().parents[2]
      +    bundle = repo_root / "plugins" / "kanban" / "dashboard" / "dist" / "index.js"
      +    js = bundle.read_text()
      +
      +    assert "function sanitizeMarkdownHtml(html)" in js
      +    assert "MARKDOWN_ALLOWED_TAGS" in js
      +    assert "sanitizeMarkdownHtml(renderMarkdown(props.source || \"\"))" in js
      +    assert "dangerouslySetInnerHTML: { __html: renderMarkdown(props.source || \"\") }" not in js
      +
      +
       # ---------------------------------------------------------------------------
       # GET /tasks/:id returns body + comments + events + links
       # ---------------------------------------------------------------------------

1 PR closed without merging

From the close comments: done elsewhere 1

  • #39949 fix(security): sanitize Kanban markdown HTML · done elsewhere → f7dfe4b, #50392, #39949
Closed issues · 1
  • Closed#31934[SECURITY] Kanban dashboard XSS via dangerouslySetInnerHTML without HTML sanitization
How this cluster was grouped
  • Link evidence (structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
  • Pairwise link density 0.67: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Subsystem
dashboard
Merged PRs
#50392
Closed issues
1
Attempts
1 PR closed without merging
Fix link checked
21 Jun 2026

For your agent

The same facts, typed.