python - 不受信任的用户可以安全使用哪个 Python 模板引擎?

标签 python security templates template-engine code-injection

我正在寻找一个很好的独立 Python 模板引擎,它是安全的,可以防止代码注入(inject),用于允许不受信任的用户编写和编辑模板的应用程序。有人可以推荐这样的引擎吗?

最佳答案

starcom 引用了 jinja。

jinja website在“功能”下说:

Sandboxed execution mode. Every aspect of the template execution is monitored and explicitly whitelisted or blacklisted, whatever is preferred. This makes it possible to execute untrusted templates.

关于python - 不受信任的用户可以安全使用哪个 Python 模板引擎?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10132781/

相关文章:

Python:鸭子类型(duck typing)与异常处理

当文件具有相同名称时,Python 代码覆盖率缺失

python - 使用 Sympy 和 Scipy 求解欠定方程组和约束

security - Lisp 应用程序和网络应用程序是否需要特殊的输入清理?

c++ - 模板化类构造函数在结构中使用错误的重载

templates - 未知类型名称 ‘vector’

python - 使用 jQuery 从 Web 服务器获取数据

c - 为什么不推荐使用带有单个参数(没有转换说明符)的 printf?

c# - 将 SetSystemTime 与受限用户帐户一起使用

wpf - DisplayMemberPath 的 ComboBox 样式问题