mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Add additional test for safe case in documentation
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
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 = env.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
|
||||
Reference in New Issue
Block a user