[Security] XSS vulnerability in markdown rendering #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The
renderMarkdown()function usesmarked.parse()and assigns the result directly toinnerHTMLwithout sanitization.Affected files
public/js/views/document.jspublic/js/views/editor.jsRisk
If a user saves a document containing malicious markdown like:
The rendered HTML will execute JavaScript.
Recommendation
Use DOMPurify or a similar library to sanitize the marked output before inserting into innerHTML.