CVE-2026-108264
Stored Jinja2 template injection allowing remote code execution and XSS.
- CVSS 9.1
- CWE-1336
- Design Defects
- Remote
Wizarr is an advanced user invitation and management system for Jellyfin, Plex, Emby, and other media servers. Prior to 2026.9.1, wizard step Markdown supplied through the editor or imported bundles was evaluated by app/blueprints/wizard/routes.py in the application's non-sandboxed Jinja2 environment with application globals exposed. An authenticated user able to create steps, or an administrator importing an untrusted bundle through POST /settings/wizard/import, could execute arbitrary Python when GET /wizard/{server}/{idx} rendered the stored step; app/jinja_filters.py and app/services/wizard_widgets.py contained additional evaluation sinks. This could execute operating-system commands as the application user, disclose the Flask SECRET_KEY, access connected service credentials and the database, and produce stored cross-site scripting. This issue is fixed in 2026.9.1.
- CWE
- CWE-1336
- CVSS base score
- 9.1
- Published
- 2026-10-09
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Design Defects
- Subcategory
- Security Misconfigurations
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Python
Solution
Upgrade Wizarr to version 2026.9.1 (or later) which patches the unsafe Jinja2 rendering vulnerability.
Vulnerable code sample
import os
from flask import Blueprint, render_template_string, request, current_app
wizard_bp = Blueprint('wizard', __name__)
# VULNERABLE: rendering user‑supplied markdown in a non‑sandboxed Jinja2 environment
def render_step(step_markdown: str):
# Use the app's global Jinja2 environment (unsafe)
env = current_app.jinja_env
template = env.from_string(step_markdown)
return template.render()
@wizard_bp.route('/wizard/<server>/<int:idx>', methods=['GET'])
def show_step(server, idx):
# In reality the markdown comes from the DB; here we mock it.
step_markdown = request.args.get('md', '')
html = render_step(step_markdown)
return htmlPatched code sample
import os
from flask import Blueprint, render_template_string, request, current_app
from jinja2.sandbox import SandboxedEnvironment
wizard_bp = Blueprint('wizard', __name__)
# FIX: render user‑supplied markdown in a sandboxed Jinja2 environment without globals
def render_step(step_markdown: str):
# Create a fresh sandboxed environment for each render
env = SandboxedEnvironment(autoescape=True)
template = env.from_string(step_markdown)
return template.render()
@wizard_bp.route('/wizard/<server>/<int:idx>', methods=['GET'])
def show_step(server, idx):
step_markdown = request.args.get('md', '')
html = render_step(step_markdown)
return htmlPublished fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix: restrict wizard template rendering (wizarrrr/wizarr)
app/blueprints/wizard/routes.py,app/blueprints/wizard/routes.py · _render,app/blueprints/wizard_admin/routes.py · preview_markdown,app/jinja_filters.py · render_jinja,app/services/wizard_widgets.py,app/services/wizard_widgets.py · ButtonWidget.render,app/services/wizard_widgets.py · process_widget_placeholders,app/services/wizard_widgets.py · RecentlyAddedMediaWidget.__init__
Cite this entry
@misc{vaitp:cve2026108264,
title = {{Stored Jinja2 template injection allowing remote code execution and XSS.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-108264},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-108264/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
