django-markdown-deux
django-markdown-deux copied to clipboard
Django-markdown-deux XSS?
[test](javascript:alert(1))
alert(1)
The sample of the patch: http://buzz.beebeeto.com/topic/5/
[[test](javascript:alert(1))](javascript:alert(1))
Bypass
@Evi1m0 WTF!
23333333
??? how to solve
It seems that the project is no longer maintained. @phith0n
I used python-xss-filter to render it again:
@register.filter(name="purifier")
def html_purifier_filter(value):
parser = XssHtml()
parser.feed(value)
parser.close()
return parser.getHtml()
html_purifier_filter.is_safe = True
Then in template
··· {{ post.content | markdown | purifier }} ···
It is not a long-term solution, but effective.
Hi @phith0n
please use this : https://github.com/bartTC/django-markup
Thanks,
@RaminFP e... django-markup used python-markdown, it doesn't seem to support extra 'code-friendly', so anything between underscores will be converted into italic or bold?