logoalt Hacker News

ks2048yesterday at 1:33 AM2 repliesview on HN

Why doesn't Jinja2 block ".__*" attribute access?


Replies

simonwyesterday at 8:28 PM

It does if you use "sandbox" mode, but that's not the default: https://jinja.palletsprojects.com/en/stable/sandbox/

pasyesterday at 8:33 PM

ehh, it's Python, it's mostly vibe-based.

https://stackoverflow.com/a/32802486

though there's sandbox: https://jinja.palletsprojects.com/en/stable/sandbox/

it simply predates the "sanitize by default" mindset/convention that nowadays React (dangerouslySetInnerHTML) and Angular has.