Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize option not in docs #31

Open
klummy opened this issue Jun 21, 2017 · 3 comments
Open

Sanitize option not in docs #31

klummy opened this issue Jun 21, 2017 · 3 comments
Assignees

Comments

@klummy
Copy link

klummy commented Jun 21, 2017

Hello,

I am not sure if this is a ng-showdown issue or Showdown issue but how to enable sanitization is missing from the docs. I had to look at multiple issues and the code itself to realise this.

Here is the option: $showdownProvider.setOption('sanitize', true)

@rjmackay
Copy link

I'd argue sanitize should default to enabled, as best practice to to have secure defaults.

@tivie
Copy link
Member

tivie commented Dec 18, 2017

Enabling "Sanitize" is kind of a "false sense of security" measure since, by itself, it does not protect against XSS attacks.

In order for it to be really secure you should follow extra steps. So enabling it by default could give the user a false sense of security. Also, it can break some legit use cases (where the user doesn't want any input to be sanitized).

Although I'm not against turning it on by default, there are legit concerns that the user might think showdown is XSS safe when it is not.

See https://github.com/showdownjs/showdown/wiki/Markdown's-XSS-Vulnerability-(and-how-to-mitigate-it) for more info.

@mtrias
Copy link

mtrias commented Apr 17, 2018

by itself, it does not protect against XSS attacks?

Could you please expand on why is this te case ?

Reading the link you pasted, it seems to me that applying ngSanitize to the output of showdown should be enough to prevent XSS, but it looks like I may be missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants