Skip to content

Commit a0997fa

Browse files
committed
fixed XSS vulnerability
HTML sanitisation was performed in incorrect place (before html content was generated from markdown).
1 parent f3d3a2f commit a0997fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/core/renderer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { markdown_to_html } from '../../renderer/pkg';
44
// Render markdown into HTML,
55
// will sanitize input to prevent possible XSS attacks
66
function render(content: string): string {
7-
content = DOMPurify.sanitize(content)
8-
return markdown_to_html(content)
7+
content = markdown_to_html(content)
8+
return DOMPurify.sanitize(content)
99
}
1010

1111
export default render

0 commit comments

Comments
 (0)