Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secure Python Markdown Library [closed]

I'd like to enable users to leave rich text comments, possibly using markdown. I've installed the libraries used on Reddit, but am concerned about the javascript injection attack which occurred last year, especially since I'm still not clear on the details of how the attack was done. Should I still be concerned about comment security? Is there a test string I can put through my system to check for the same flaws that took down reddit?

like image 791
MichaelBlume Avatar asked Mar 01 '10 18:03

MichaelBlume


2 Answers

reddit uses the discount markdown library now.

like image 79
jedberg Avatar answered Nov 05 '22 16:11

jedberg


Python-Markdown - the 'standard' one more or less - has a 'safe mode' feature that escapes html tags. That should be enough to counter most all HTML injection attacks.

like image 26
Wander Nauta Avatar answered Nov 05 '22 17:11

Wander Nauta