Skip to content

🐛 [Bug]: Django (pongo2) integration vulnerability to XSS #281

@bastianwegge

Description

@bastianwegge

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:

  1. Create a basic project including gofiber + gofiber/template/django
  2. Create a variable with a string <script>alert("ALERTAAAA");</script>
  3. Print the variable into a template
  4. You have a potential XSS attack if the variable was created by user-input

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:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

Metadata

Metadata

Assignees

Labels

☢️ BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions