5 ms·
Seems to me this is more about the danger of passing anything derived from user input into the TEMPLATE side of a templating engine. Why in the world would you
by ufmace 2y ago
Seems to me this is more about the danger of passing anything derived from user input into the TEMPLATE side of a templating engine. Why in the world would you ever do that?!?
Obviously if you pass data into the variable side of the engine, you hardly have to worry about it at all, since it's already going into a place that was designed for handling arbitrary and possibly-hostile input and been battle-tested at doing it correctly in Production for many years. If you pass it into the template side, you're betting that you can be as good as dozens of templating engine writers working for a decade at doing that, in exchange for, well, I can't really think of any possible legitimate advantage for doing that.
- klysm 2y agoWhat if you want to allow users to regex search their documents?
- ses1984 2y agoDo it on the client side? Do it in a sandbox and have aggressive timeouts.
- klysm 2y ago> Do it on the client side? Not practical given a large amount of documents. > Do it in a sandbox and have aggressive timeouts. Sure! I was just replying to this: > the danger of passing anything derived from user input into the TEMPLATE side of a templating engine. Why in the world would you ever do that?!?