Security question: Can Django templates be used to execute arbitrary code on the server?

13 views
Skip to first unread message

jrief

unread,
May 5, 2020, 7:51:31 PM5/5/20
to Django users
Is it safe to keep Django template strings inside a TextField of a Django model and allow users with staff privileges to edit them?

I'm asking because I'm unsure how safe/dangerous this could be. Would it be possible to abuse a built-in templatetag to execute arbitrary code on the server?

What are possible attack scenarios? XSS for sure, but that's always possible to whom you allow to publish HTML on their servers.
Reply all
Reply to author
Forward
0 new messages