/

CVE-2026-33154

Severity:

HIGH RISK

(7.5)

Server-Side Template Injection (SSTI) in Dynaconf @Jinja

CVE-2026-33154

Analyzed

Vulnerability type

Category:

Server-Side Template Injection (SSTI)

CWE:

CWE-94, CWE-1336, CWE-78

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Dynaconf's @Jinja resolver evaluates Jinja2 template expressions inside configuration values without sandboxing, leading to a Server-Side Template Injection (SSTI) condition.

When untrusted configuration data can reach these templates and the jinja2 package is installed, an attacker may abuse template evaluation to execute arbitrary code or access sensitive data on the server.

Affected context

This vulnerability affects Python applications that:

  • Use Dynaconf for configuration management
  • Enable or rely on the @Jinja resolver to process template-like configuration values
  • Have the jinja2 package installed in the runtime environment
  • Allow user-controlled or otherwise untrusted data to be stored in, or influence, Dynaconf-managed configuration values

In such setups, template expressions embedded in configuration entries are evaluated with powerful capabilities instead of being treated as inert data.

Exploit preconditions

  • Attack surface: Any code path where Dynaconf loads and resolves configuration values annotated for Jinja processing (e.g., values using @Jinja or equivalent mechanisms).
  • Required access: Ability to influence or control configuration data consumed by Dynaconf (e.g., configuration files, environment variables, dynamic settings, or external sources wired into Dynaconf).
  • Trigger point: The moment Dynaconf resolves configuration values and invokes the Jinja2 engine to render template expressions.
  • Why exploitation is possible: The template engine is invoked without a sandboxed or restricted environment, exposing powerful Jinja2 features to attacker-controlled expressions and enabling arbitrary expression evaluation in a server-side context.

Why this happens

The underlying flaw aligns with CWE-94: Improper Control of Generation of Code ('Code Injection') and CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.

Dynaconf's @Jinja resolver treats configuration values as templates and evaluates them using Jinja2 without adequately constraining what templates can do or which inputs are trusted.

This pattern effectively promotes configuration data into executable template logic and fails to enforce a strict separation between data and code.

In environments where configuration sources may be influenced by end users or external systems, this unbounded template evaluation creates a direct path from untrusted input to server-side expression execution.

Potential impact

  • Execution of arbitrary code in the context of the affected Python process
  • Access to sensitive configuration values, secrets, and environment variables
  • Unauthorized file reads or interaction with local resources accessible to the application
  • Escalation from configuration tampering to full application or host compromise
  • Lateral movement within the environment if the compromised process has network privileges

General mitigation guidance

Mitigations typically focus on removing or strictly constraining the ability of untrusted data to become executable template content:

  • Avoid using dynamic template evaluation for configuration values unless absolutely necessary; prefer static or literal configuration data.
  • Treat all configuration sources as untrusted by default and avoid routing them through powerful template engines.
  • If template resolution is required, restrict it to trusted, curated inputs and disable template processing for user- or externally-controlled values.
  • Use sandboxed or restricted template environments that limit available functions, builtins, and environment access when processing configuration templates.
  • Apply least-privilege principles to the runtime process so that, even if templates are abused, accessible resources and system impact are constrained.

How teams detect issues like this

Detection can combine code-level analysis with configuration and deployment reviews:

  • Static analysis: Search for uses of Dynaconf's @Jinja resolver or any code paths that call Jinja2 render methods on configuration-derived values; flag cases where input can originate from external sources.
  • Code review: Examine configuration loading pipelines, paying attention to decorators, resolvers, or hooks that transform configuration values using template engines; look for mixing of user-influenced data with template evaluation.
  • Configuration review: Audit how configuration is supplied (files, environment variables, remote stores) and identify fields that may embed Jinja expressions; verify whether those sources are controlled or validated.
  • Policy enforcement: Enforce internal guidelines that prohibit server-side template evaluation of data originating from untrusted sources, and use automated checks in CI to detect new instances of unsafe template evaluation.

Sources

SourceLink
github.comgithub.com/dynaconf/dynaconf/commit/2fbb45ee36b8c0caa5b924fe19f3c1a5e8603fa7
github.comgithub.com/dynaconf/dynaconf/releases/tag/3.2.13
github.comgithub.com/dynaconf/dynaconf/security/advisories/GHSA-pxrr-hq57-q35p

Frequently asked

questions

It can be, if remote users can influence configuration values that Dynaconf processes through the @Jinja resolver. For example, if user input is persisted into configuration-like storage or mapped into environment variables consumed by Dynaconf, an attacker may trigger SSTI remotely.

That depends on how configuration data is populated in your application. If only trusted operators can modify configuration sources, the risk is primarily insider or supply-chain driven. If external or unauthenticated inputs influence configuration, then unauthenticated exploitation may be possible.

The safest approach is to avoid evaluating templates on configuration values altogether, or at least strictly disable template processing for any data that can originate from untrusted sources. Where evaluation is unavoidable, constrain the template environment, expose only minimal, non-dangerous functions, and treat templates as a privileged feature controlled solely by trusted administrators.

Establish clear boundaries between data and executable logic, and avoid features that implicitly convert configuration values into code or templates. Adopt secure defaults in configuration libraries, perform security reviews for any use of template engines, and add automated checks in your development pipeline to flag server-side template evaluation of untrusted input.

Find out what's already
exploitable in your codebase.