Summary
Kestra's execution-file preview feature renders user-supplied Markdown with HTML enabled and injects the resulting HTML into Vue templates using v-html without sanitisation.
In affected versions, an attacker who can upload or control .md files may execute arbitrary JavaScript in other users' browsers when they view the rendered preview.
Affected context
This vulnerability occurs in the web-based execution-file preview inside Kestra when it processes Markdown files (.md) associated with workflows or tasks.
The risk is present when:
- Users can upload, attach, or otherwise control Markdown content rendered by the preview feature
- The application renders Markdown with
markdown-itconfigured ashtml: true - The rendered HTML is injected into Vue components using
v-htmlwithout any sanitisation or HTML filtering
In multi-user or integrated environments (e.g., where Markdown can be supplied via automation, plugins, or external systems), this behavior can expose other Kestra users who view the preview.
Exploit preconditions
- Attack surface: Kestra web UI, specifically the execution-file preview that renders Markdown content.
- Required access: Ability to provide or influence Markdown files processed by the preview (e.g., upload, edit, or integration that writes
.mdcontent). - Victim interaction: Another user with access to the Kestra UI must open or preview the malicious Markdown file for the payload to execute.
- Trigger point: Rendering of user-supplied Markdown where:
markdown-itis instantiated withhtml: true, allowing raw HTML in Markdown- The resulting HTML is bound into the DOM via Vue's
v-htmldirective - Why exploitation is possible: No sanitisation or HTML/JavaScript filtering is applied between user-controlled Markdown and the final HTML inserted into the DOM, enabling injection of scripts or event handlers.
Why this happens
The core issue is a Cross-Site Scripting (CWE-79) vulnerability caused by combining two unsafe patterns:
- Rendering user-controlled Markdown with
markdown-itconfigured ashtml: true, which allows embedded raw HTML in Markdown to pass through unchanged. - Injecting the resulting HTML into the Vue application with
v-html, which directly inserts HTML into the DOM without built-in sanitisation.
This design treats user content as trusted HTML and does not apply an output-encoding or sanitisation layer before DOM insertion.
As a result, attacker-controlled script tags, event handlers (on* attributes), or other XSS vectors can execute arbitrary JavaScript in the context of the Kestra web application.
Potential impact
- Theft of session identifiers, CSRF tokens, or other sensitive data accessible in the victim's browser.
- Impersonation of the victim within the Kestra UI (e.g., executing actions with their privileges).
- Tampering with displayed workflow or execution data to mislead operators.
- Pivoting to other internal applications via the victim's browser if integrated single sign-on or shared authentication is used.
- Installation of malicious browser-based backdoors (e.g., persistent scripts via stored XSS in other fields, if reachable).
- Collection of sensitive operational information about orchestrated tasks and associated systems.
General mitigation guidance
Effective mitigation focuses on treating Markdown and HTML output as untrusted data and minimising the use of raw HTML injection:
- Prefer Markdown rendering configurations that disable raw HTML (e.g., turning off
html: trueinmarkdown-it) when processing untrusted content. - Introduce a server-side or client-side HTML sanitisation layer between the Markdown renderer and the DOM to strip scripts, event handlers, and dangerous attributes.
- Avoid or strictly limit the use of
v-htmland similar raw HTML injection mechanisms; instead, rely on safe component-based rendering or frameworks that handle encoding by default. - Segment privileges so that users who can supply Markdown content do not necessarily have high-privilege operational roles, reducing blast radius.
- Apply Content Security Policy (CSP) with restrictive script sources to make XSS exploitation harder, while acknowledging that CSP should complement, not replace, proper sanitisation.
- Treat any user-controllable documentation or preview features as potential injection points and adopt secure-by-default patterns there first.
How teams detect issues like this
Detection generally involves reviewing frontend rendering patterns and identifying untrusted HTML flows:
- Use static analysis or linting rules for Vue and JavaScript that:
- Flag uses of
v-htmland similar direct DOM injection APIs (innerHTML,dangerouslySetInnerHTML, etc.). - Highlight Markdown renderer instantiations where
html: trueor equivalent untrusted HTML options are enabled. - Perform targeted code review focusing on:
- Paths where user-supplied or file-based content is transformed and rendered into the UI.
- Any bypass of sanitisation libraries or custom filters.
- Employ dynamic application security testing (DAST) or automated browser-based scanners configured to:
- Upload or submit crafted Markdown payloads.
- Detect JavaScript execution upon viewing previews or rendered content.
- Integrate these checks into CI/CD pipelines so new uses of
v-htmlor changes to Markdown configuration trigger security review. - Optionally use automated security review tools that understand framework-specific sinks (e.g., Vue's
v-html) and mark them as high-risk when fed by untrusted data.

