P0+P1 fixes: RCE sandbox, SQL injection, RLS tenant isolation, DB roles, test syntax, attachment, permission registry, membership check
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -77,10 +77,12 @@ def _report_to_response(r: ReportInstance) -> dict:
|
||||
|
||||
|
||||
def _render_jinja2(template_content: str, data: dict) -> str:
|
||||
"""Render a Jinja2 template string with the given data."""
|
||||
from jinja2 import Environment, StrictUndefined
|
||||
"""Render a Jinja2 template string with the given data (sandboxed)."""
|
||||
from jinja2 import StrictUndefined
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
|
||||
env = Environment(autoescape=False, undefined=StrictUndefined)
|
||||
env = SandboxedEnvironment(autoescape=True, undefined=StrictUndefined)
|
||||
env.globals.clear()
|
||||
template = env.from_string(template_content)
|
||||
return template.render(**data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user