-
Notifications
You must be signed in to change notification settings - Fork 54
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
🐛 [Bug]: Django (pongo2) integration vulnerability to XSS #281
Comments
We could add a config value for this, would that work for you @bastianwegge ? |
@sixcolors I'd say yes. Is there a use case for having this disable? |
Not sure. I’ll have to read pnogo2 docs. There are valid reasons to allow unsafe. But I don’t know why you would do it globally. Unless it doesn’t have a way to do it selectively. |
@sixcolors It only works per template or globally. flosch/pongo2#312 We can add it as a config variable, and enable it by default |
So docs are non existent for pongo2. But https://github.com/flosch/pongo2/blob/c84aecb5fa79a9c0feec284a7bf4f0536c6a6e99/template_tests/autoescape.tpl -> https://github.com/flosch/pongo2/blob/c84aecb5fa79a9c0feec284a7bf4f0536c6a6e99/template_tests/autoescape.tpl.out suggests it can be done in the template. I would set it to true in the django.go and let them use disable in the template. we could add a config option or not. But secure by default on templates would be my preference. |
@sixcolors Agree! I will work on a PR |
Hey @gaby, we went with something completely different because of the security issues. Rene suggested to open an issue so this wouldn't go unnoticed. |
I plan on updating all the unit-tests today. The output is quite different that without escaping! |
Could be in the way the template is passed in. I’ll take a look when I get off work. On Jan 8, 2024, at 10:27 AM, Juan Calderon-Perez ***@***.***> wrote:
I plan on updating all the unit-tests today. The output is quite different that without escaping!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Bug Description
Currently inside of pongo2 there's a setting that sets
pongo2.SetAutoescape(false)
which disables HTML sanitization, as far as I can see. This makes the gofiber/template/django integration unusable for my project.How to Reproduce
Steps to reproduce the behavior:
<script>alert("ALERTAAAA");</script>
Expected Behavior
I'd expect HTML sanitization to be active at all times. I'd also expect some documentation on how to explicitly deactivate sanitization for a non-user-input variable that is able to render valid HTML.
Template package Version
Django - v3.1.5
Code Snippet (optional)
No response
Checklist:
The text was updated successfully, but these errors were encountered: