Files
codeql/python/ql/test/library-tests/frameworks/jinja2/template_test.py
Joe Farebrother ebaab89933 Formatting updates
2024-12-09 19:57:25 +00:00

11 lines
476 B
Python

from jinja2 import Environment, Template
from jinja2.sandbox import SandboxedEnvironment
def test():
env = Environment()
t = env.from_string("abc") # $ templateConstruction="abc"
t = Template("abc") # $ templateConstruction="abc"
env2 = SandboxedEnvironment()
t = env2.from_string("abc") # No result as we don't model SandboxedEnvironment. We may wish to instead specifically model it as NOT vulnerable to template injection vulnerabilities.
return t