Skip to content

Feature/support markdown - #1688

Draft
dabbinavo wants to merge 8 commits into
OWASP:mainfrom
dabbinavo:feature/support-markdown
Draft

Feature/support markdown#1688
dabbinavo wants to merge 8 commits into
OWASP:mainfrom
dabbinavo:feature/support-markdown

Conversation

@dabbinavo

@dabbinavo dabbinavo commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary:

Closes #1326

Description for the changelog:

Add markdown support.

Declaration:

Thanks for submitting a pull request, please make sure:

  • content meets the license for this project
  • appropriate unit tests have been created and/or modified
  • you have considered any changes required for the functional tests
  • you have read the contribution guide and agree to the Code of Conduct
  • either no AI-generated content has been used in this pull request
  • or any use of AI in this pull request has been disclosed below:
    • AI Tools: GitHub Copilot Inline Suggestions

Other info:

Work in Progress. Already added markdown support to

  • High level system description
  • Threat Description
  • Threat Mitigations
  • Components: Descriptions
  • Components: Reason for out of scope
  • Add markdown switch to threat model
  • Render preview conditionally based on switch

@dabbinavo
dabbinavo force-pushed the feature/support-markdown branch from 1d5182a to 17b089d Compare June 3, 2026 11:07
@lreading lreading assigned lreading and dabbinavo and unassigned lreading Jun 6, 2026
@lreading lreading added the Usability UX & Accessibility Strategic pillar from Threat Dragon's roadmap label Jun 6, 2026
Comment thread package.json Outdated
@lreading

Copy link
Copy Markdown
Collaborator

I know this is still a WIP - but I wanted to bring up a potential security concern with using Vue's v-html. v-html does not sanitize input, nor does marked. This means this could become an XSS vector:

<img src=x onerror=alert(1)>
[click me](javascript:alert(1))
<svg onload=alert(1)>
<a href="javascript:alert(1)">x</a>

OWASP's XSS CheatSheet recommends using DOMPurify for HTML sanitzation.

Instead of sanitizing at every element where we render markdown, we could use a shared helper instead:

import { marked } from 'marked';
import DOMPurify from 'dompurify';

export function renderMarkdown(input = '') {
    const html = marked.parse(input, {
        gfm: true,
        breaks: true
    });

    //  allow all safe HTML elements but neither SVG nor MathML
    // https://github.com/cure53/DOMPurify#control-our-allow-lists-and-block-lists
    return DOMPurify.sanitize(html, { USE_PROFILES: { html: true } })
}

Then every place Markdown is rendered, we can call the shared function for consistent rendering and sanitization:

<div v-html="renderMarkdown(threat.description)"></div>

Again, if there's anything I can help with, please let me know! Really appreciate all the work you're putting into this!

@dabbinavo

Copy link
Copy Markdown
Collaborator Author

Thanks for this awesome thoughts and input. This is really a big thing regarding security and also simplifies the code/logic 👍

@dabbinavo
dabbinavo force-pushed the feature/support-markdown branch from a24d704 to 9274da4 Compare June 17, 2026 10:58
@dabbinavo
dabbinavo force-pushed the feature/support-markdown branch from 34eee6e to 9b24ae3 Compare July 7, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Usability UX & Accessibility Strategic pillar from Threat Dragon's roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hyperlinks in threat descriptions

2 participants