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: [email protected]
> On Sep 6, 2014, at 12:08 AM, Andrei Fangli <[email protected]> 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.
Alan
_______________________________________________
Markdown-Discuss mailing list
[email protected]
http://six.pairlist.net/mailman/listinfo/markdown-discuss
_______________________________________________
Markdown-Discuss mailing list
[email protected]
http://six.pairlist.net/mailman/listinfo/markdown-discuss