yogthos/markdown-clj

Prevent potential XSS by default

开放

#188 创建于 2022年10月12日

 (1 条评论) (0 个反应) (0 位负责人)Clojure (120 个派生)github user discovery
bughelp wanted

仓库指标

星标
 (570 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Example markdown:

[click me](javascript:window.onerror=alert;throw%20document.URL)

Markdown clj will render:

Maybe we force folks to specify specific protocols they want to support and validate the urls? We just discovered this and haven't done much analysis at this point.

This is what other popular Java markdown tools do:

https://github.com/commonmark/commonmark-java/blob/main/commonmark/src/main/java/org/commonmark/renderer/html/DefaultUrlSanitizer.java

Note, this doesn't affect other online editors either:

https://dillinger.io/ https://stackedit.io/app# https://jbt.github.io/markdown-editor/

贡献者指南