#17419: JSON template tag -----------------------------------+------------------------------------- Reporter: lau | Owner: aaugustin Type: New feature | Status: closed Component: Template system | Version: master Severity: Normal | Resolution: wontfix Keywords: json template tag | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -----------------------------------+------------------------------------- Changes (by aaugustin):
* status: new => closed * resolution: => wontfix Comment: I've finally changed my mind on this ticket. There's a good reason why it isn't recommended to just include raw JSON data in the HTML: it's [https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet extremely hard to prevent XSS] unless you enforce other rules about the context, and this isn't under the control of Django. It's obviously possible to solve the problem for particular use cases with controlled data. In such cases, the implementation only takes a few lines (see the first patch on this ticket). However, it appears very hard to provide a general `|json` filter that will be safe in all contexts. If you think you have a working implementation, please submit it on the mailing list. I'll expect strong evidence that it's secure :) -- Ticket URL: <https://code.djangoproject.com/ticket/17419#comment:18> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.