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

XSS Injection #20

Closed
sauloh opened this issue Jun 4, 2016 · 4 comments
Closed

XSS Injection #20

sauloh opened this issue Jun 4, 2016 · 4 comments

Comments

@sauloh
Copy link

sauloh commented Jun 4, 2016

django-machina is vulnerable do XSS Injection when user creates a topic.

you just have create or reply a topic with:
<script>alert('hello');</script>

@ellmetha
Copy link
Owner

ellmetha commented Jun 4, 2016

Hi,
Thanks for pointing this out! This was related to a missuse of the django-markdown's markdown function (which requires the use of a safe argument to enforce the "safe" mode).
I'll release a new version of django-machina during the day.

A quick fix is to set the MACHINA_MARKUP_LANGUAGE setting as follows:

MACHINA_MARKUP_LANGUAGE = ('django_markdown.utils.markdown', {'safe': True})

@sauloh
Copy link
Author

sauloh commented Jun 4, 2016

Hi,

I'm the one who should thank you for the quick fix.

But I saw this in markdown docs: https://pythonhosted.org/Markdown/reference.html#safe_mode

Warning “safe_mode” is deprecated and should not be used.

Is it the same thing you mentioned, or am I confused?

@ellmetha
Copy link
Owner

ellmetha commented Jun 4, 2016

Hi,

I was referring to the safe argument of the django-markdown's markdown function (see https://github.com/klen/django_markdown/blob/develop/django_markdown/utils.py#L31).

But indeed this is related to the "safe_mode" of the Markdown Python module, which seem to be deprecated. This should be fixed inside the django-markdown module and not in django-machina.

I plan to replace django-markdown by another solution in the next 0.3 release of django-machina.

@sauloh
Copy link
Author

sauloh commented Jun 4, 2016

Oh, understood!

Thanks!

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

2 participants