Is freemarker safe when user can edit their template
3 answers
John is right. And letting the user actually edit the freemarker templates themselves seems strange. If you re-enter user input (for example, display your search query on the results page), I would suggest using with an inline inline html string, this saves you the most basic xss attacks (eg "you searched" '$ {term? HTML} '").
0
a source to share
So as others have said, it is not safe. However, if these users are employees of your company or something like that (that is, if they are easily accountable for malicious acts), then this is not entirely out of the question. See http://freemarker.org/docs/app_faq.html#faq_template_uploading_security for details
0
a source to share