Re: when rational discussion was still a possibility

Andrei Fangli andrei_fangli at
Sat Sep 6 04:10:14 EDT 2014

True, xss hack prevention is a requirement regardless of where markdown transformation takes place. However…

While on the back end the only concern is xss, while when parsing at the front end and sending it to the server the whole input has to be validated for html and xss.

When accepting posts from users using Markdown as a formatting language there is a chance that someone may simply make a http web request using the action url found in your html post form and send what ever data he wants (assuming the back end expects html, that’s why there’s an extra validation step required at the server when using JavaScript to parse and post the resulted html. I’m not talking about simply checking for well formed html, stripping tags is next after that).

Andrei Fangli

From: Alan Hogan
Sent: ‎Saturday‎, ‎6‎ ‎September‎ ‎2014 ‎10‎:‎59
To: markdown-discuss at

> On Sep 6, 2014, at 12:08 AM, Andrei Fangli <andrei_fangli at> wrote:
> The JavaScript version is only good for preview at client-side to avoid posting to the server one to many times. To do client-side parsing and sending it to the server in the final format is a serious security leak (trusting that a post request sends a valid and harmless html is wishful thinking).

There’s little difference: if you are accepting markdown from untrusted users, you MUST also pass the resulting HTML through an XSS filter of some sort, no matter whether the markdown transform happens on the front or back end. 

Markdown-Discuss mailing list
Markdown-Discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Markdown-Discuss mailing list