Summary
Kestra contains a stored cross-site scripting vulnerability in its custom Markdown link parser. A user who can create or update a Flow description may inject JavaScript event-handler attributes that execute when another user opens the description or information panel.
Affected context
The issue occurs in Kestra's web interface when Flow descriptions are processed by the custom Markdown parser supporting the [[link]] syntax. It becomes risky when a user has permission to create or update Flow descriptions and other users later view the affected description or Flow information panel.
Exploit preconditions
- Attack surface: Kestra's web UI and custom Markdown rendering functionality
- Required access: Permission to create or update a Flow description
- Trigger point: A different user opens the affected description or information panel
- Why exploitation is possible: The custom parser permits attacker-controlled attributes to reach rendered HTML without sufficiently restricting executable event-handler content
Why this happens
The vulnerability results from insufficient output handling in a custom Markdown-to-HTML transformation. User-controlled Flow description content is interpreted as markup, and attacker-controlled event-handler attributes can remain active in the rendered result.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), specifically a stored XSS pattern in which malicious content is persisted and later rendered in another user's browser.
Potential impact
- An attacker may execute JavaScript in another user's browser context
- A successful attack could access data exposed to the victim's Kestra session
- The vulnerability may enable unauthorized actions through the victim's permissions
- Attackers could alter displayed Flow information or conduct phishing within the application
- The issue could contribute to broader account or workflow compromise depending on user privileges
General mitigation guidance
Mitigation generally focuses on treating Flow descriptions as untrusted content throughout parsing, storage, and rendering.
Common defensive patterns include:
- Restricting custom Markdown syntax to a narrowly defined allowlist
- Removing event-handler attributes and other executable markup before rendering
- Applying context-aware output encoding and HTML sanitization
- Rendering user-authored descriptions in a constrained context where possible
- Separating content-editing permissions from sensitive workflow administration privileges
- Using secure browser policies, such as an appropriate Content Security Policy, as a defense-in-depth control
- Preserving untrusted-data boundaries even for users who are authenticated or otherwise authorized to edit descriptions
How teams detect issues like this
Organizations can detect similar issues through:
- Static analysis rules for unsafe HTML construction, string-based markup transformation, and unsanitized template output
- Code review checks for custom Markdown extensions that copy user-controlled attributes into HTML
- Tests covering stored content containing markup, attributes, and browser-executable contexts
- Dynamic application testing that verifies persisted descriptions are rendered without executable content
- Policy enforcement requiring approved sanitization libraries and explicit HTML allowlists
- Monitoring for unusual Flow-description changes and unexpected script-like markup in stored content
Automated security review tools may help identify dangerous rendering paths, but parser-specific behavior still benefits from targeted tests and manual review.

