bandit/examples/mako_templating.py
Rob Fletcher 27eea75f3c Add mako templating plugin and XSS profile
Adds plugin to warn on Mako templates. Since mako does not have template wide
autoescaping (that we can verify is turned on), a developer is responsible to
escape each variable individually in the templates. This is higher than info
because the *only* way to escape is via the variables, but not set to ERROR
because we can't know for sure if any of those variables are used and/or
malicious.

Also add an XSS profile.

Change-Id: I65515f9584d67d8b7b58b71b6ddb447c307675d1
2015-03-05 08:44:09 -08:00

12 lines
292 B
Python

from mako.template import Template
import mako
from mako import template
Template("hello")
# XXX(fletcher): for some reason, bandit is missing the one below. keeping it
# in for now so that if it gets fixed inadvertitently we know.
mako.template.Template("hern")
template.Template("hern")