
Scanner and proof-of-concept exploit for CVE-2025-23211, a Jinja2 SSTI RCE in Tandoor Recipes < 1.5.24, with a five-request detection flow and CSV/JSON reporting.

Fast YAML-based vulnerability scanner with template-driven detection engine for automated security testing across web apps, APIs, networks, DNS, and cloud infrastructure.

Open-source web application security scanner for automated vulnerability detection, manual penetration testing, and API security testing with a proxy-based interception engine.

This repository contains the scanner component for Greenbone Community Edition.
Tandoor Recipes < 1.5.24 - Jinja2 SSTI RCE
| field | value |
|---|---|
| CVE | CVE-2025-23211 |
| severity | critical |
| CVSS | 9.9 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) |
| fixed in | Tandoor Recipes 1.5.24 (affected: < 1.5.24) |
| class | Code injection / SSTI (CWE-94, CWE-1336) |
| scanner version | 1.0.0 |
| python | 3.8+ stdlib only, no third-party deps |
If you want the exploit, find it here: https://satoshidisk.com/pay/CT53Es
Tandoor Recipes < 1.5.24 has a Jinja2 SSTI vulnerability that allows command execution via recipe steps. The nuclei template (http/cves/2025/CVE-2025-23211.yaml, max-request: 5) drives a five-request flow: fetch the csrf token from /accounts/login/, log in (302 + csrftoken cookie), POST /api/recipe/ to create a recipe (201, returns id and steps[0].id), PUT /api/recipe/<id>/ with the jinja2 expression as the step instruction, then GET /api/recipe/<id>/ and confirm the body carries "instructions_markdown" plus the computed numeric product of the two probe integers, with Content-Type: application/json and status 200.
In pre-1.5.24 cookbook/helper/template_helper.py, render_instructions() parses the step instruction with the markdown package and then hands the raw string to jinja2.Template(instructions) and calls template.render(ingredients=ingredients, scale=scale) on an unsandboxed template object. Because the environment is not a SandboxedEnvironment, every expression in the user-controlled step instruction is evaluated by Jinja2 itself, so {{ 7*1 }}-style arithmetic, {{ ''.__class__.__mro__ }} introspection chains and |attr()/__globals__ lookups all resolve server-side and are reflected back verbatim in the instructions_markdown field of the API JSON response.
The fix (commit e6087d5129cc9d0c24278948872377e66c2a2c20) builds a jinja2.sandbox.SandboxedEnvironment(), renders via env.from_string(instructions).render(...) and adds a SecurityError branch returning Could not parse template code. Error: Security Error; the restricted environment blocks most attribute traversal chains.
Impact: authenticated attackers (PR:L, internal recipes need a logged-in session) get arbitrary expression evaluation on the server, i.e. full server compromise, data disclosure and privilege escalation from a single 9.9 CRITICAL sandbox-escape-prone SSTI. EPSS 0.03666 (89.9 percentile). Remediation: upgrade to Tandoor Recipes 1.5.24 or later.
max-request: 5).GET /accounts/login/ -> regex name="csrfmiddlewaretoken" value="(.*?)".POST /accounts/login/ with csrfmiddlewaretoken=<csrf>&login=<user>&password=<pass>&remember=on&next=%2F; matcher: status 302; extractor: csrftoken=([A-Za-z0-9]+) from Set-Cookie.POST /api/recipe/ with X-CSRFToken; matcher: status 201; extractors: .id, .steps[0].id.PUT /api/recipe/<id>/ with the step instruction set to the raw jinja2 expression {{ (812345*901237)|int }}; matcher: status 200.GET /api/recipe/<id>/; matchers (AND): body contains "instructions_markdown", body contains the computed product 732115370765, content_type contains application/json, status 200.check() returns the same AND-combined verdict the template DSL encodes.Scanner:
python3 scanner/CVE-2025-23211/scanner.py urls.txt 8 out.csv --json out.json
urls.txt: one base URL per line, # comments allowed, scheme optional
8 : worker threads (default 8)
out.csv : streamed report (default CVE-2025-23211.csv)
python3 exploit/CVE-2025-23211/exploit.py http://127.0.0.1:8080 --csv ex.csv --json ex.json --verbose
target : base URL of the Tandoor instance
--csv : optional key/base64-value dump
--json : optional full result JSON
--verbose: repeat the raw result as a log line
[*] Tandoor Recipes CVE-2025-23211 SSTI scanner (jinja2 recipe steps)
scanner : CVE-2025-23211 v1.0.0
threads : 8 | csv: out.csv | json: out.json
[2026-12-03 09:12:44] loaded 1 target(s) from urls.txt
[2026-12-03 09:12:45] [1/1] http://127.0.0.1:8080 -> VULNERABLE
[2026-12-03 09:12:45] summary: total=1 vulnerable=1 not-vuln=0 errors=0
[2026-12-03 09:12:45] timing : avg=640ms max=640ms wall=0.66s
[2026-12-03 09:12:45] report saved: out.csv
| column | meaning |
|---|---|
| n | 1-based row number |
| url | target as provided (scheme auto-prepended if missing) |
| status | ok or error |
| vulnerable | True/False verdict from check() |
| elapsed_ms | per-target timing |
| token | 12-char md5 over the JSON result details |
| result_b64 | base64(JSON) full details |
scanner/CVE-2025-23211/scanner.py - batch black-box scanner, streamed CSV + JSON sidecar.exploit/CVE-2025-23211/exploit.py - single-target two-stage POC (login + create, then SSTI evaluate).scanner/CVE-2025-23211/README.md - this note.scanner/CVE-2025-23211/DESCRIPTION.md - architecture, probe plan, token scheme, matcher notes.| code | meaning |
|---|---|
| 0 | at least one target answered (normal completion) |
| 2 | every target errored (no usable response) |
http/cves/2025/CVE-2025-23211.yaml (projectdiscovery/nuclei-templates)cookbook/helper/template_helper.py at 4f9bff20c858180d0f7376de443a9fe4c123a50c, fix commit e6087d5129cc9d0c24278948872377e66c2a2c20