Skip to content

XSS due to misconfigurations #333

@IceWizard4902

Description

@IceWizard4902

Vulnerability Details

Hi, I want to report a possible XSS due to a misconfiguration in markmap-lib. The following configuration will render user input as HTML

export function initializeMarkdownIt() {
const md = MarkdownIt({
html: true,
breaks: true,
});

This can allow a malicious attacker to specify a malicious HTML payload, such as

<img src=x onerror=alert(window.origin)>

You can verify this vulnerability exists by navigating to the markmap REPL and type the following payload

- xss: <img src=x onerror=alert(window.origin)>

An alert box should pop up with the domain of the website, indicating a XSS vulnerability

Image

This also leads to a XSS vulnerability in another application that uses markmap-lib, which can be found in this issue

Mitigation

Markmap can sanitize the final HTML input from the user, or restrict the HTML tags that can be specified inside the markdown

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions