CVE-2026-33154: Dynaconf Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-pxrr-hq57-q35p
CVSS 7.5
CWE-78 CWE-94 CWE-1336
Published
Advisory Summary

CVE-2026-33154 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Dynaconf libraries in the PyPI ecosystem. The issue involves dynaconf affected by remote code execution (rce) via insecure template evaluation in @jinja resolver. Remediation is available by upgrading affected packages to version 3.2.13.

CVE-2026-33154 at a Glance

CVE Identifier CVE-2026-33154
GHSA Identifier GHSA-pxrr-hq57-q35p
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Dynaconf
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-33154

To remediate this vulnerability, upgrade all affected Dynaconf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

dynaconf fixed: 3.2.13
pip install dynaconf>=3.2.13
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show dynaconf

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-33154, inspect your installed packages using pip:

pip show dynaconf

Analyze the terminal output to locate any version of Dynaconf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.13), your application is affected.

Note: The pip show dynaconf command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Dynaconf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary 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: environment variables .env files container environment configuration CI/CD secrets 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. ### Details The vulnerability arises because Dynaconf's string resolvers lack proper security boundaries. 1. @jinja Resolver 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. 2. @format Resolver The @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 - API keys - database credentials - internal service tokens - environment secrets ### PoC ``` 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) ``` ### Impact Successful exploitation allows attackers to: - Execute arbitrary OS commands on the host system - Access sensitive environment variables - Compromise application secrets - Fully compromise the running application process 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. ### Remediation / Mitigation (Examples) 1. Use Jinja2 sandbox for template rendering ``` from jinja2.sandbox import SandboxedEnvironment env = SandboxedEnvironment() template = env.from_string("{{ config_value }}") safe_value = template.render(config_value=user_input)``` ``` 2. Restrict @format usage to trusted values ``` safe_value = "{name}".format(name=trusted_name) ```

CVE-2026-33154 Affected Dynaconf Versions

1 component(s)
Fixed Versions:
3.2.13
Product / Package Ecosystem Affected Versions Fixed Version
dynaconf
PyPI
< 3.2.13
3.2.13

References

Frequently Asked Questions

What is CVE-2026-33154?
CVE-2026-33154 is a security vulnerability in Dynaconf involving dynaconf Affected by Remote Code Execution (RCE) via Insecure Template Evaluation in @jinja Resolver under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Dynaconf versions are affected?
Affected versions include releases prior to 3.2.13 across affected packages: dynaconf.
What version fixes CVE-2026-33154?
Upgrading to 3.2.13 (or the latest patched release for your respective branch) resolves the vulnerability.
Is dynaconf affected?
Yes, dynaconf is affected in releases prior to 3.2.13. Upgrade your dependency to 3.2.13 or later.
What is the CVSS score of CVE-2026-33154?
CVE-2026-33154 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-33154?
CVE-2026-33154 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2026-33154?
Run the dependency tree command: 'pip show dynaconf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pxrr-hq57-q35p",
  "modified" : "2026-04-14T21:59:25Z",
  "published" : "2026-03-18T20:08:06Z",
  "aliases" : [ "CVE-2026-33154" ],
  "summary" : "dynaconf Affected by Remote Code Execution (RCE) via Insecure Template Evaluation in @jinja Resolver",
  "details" : "### Summary\nDynaconf is vulnerable to Server-Side Template Injection (SSTI) due to unsafe template evaluation in the @jinja resolver.\nWhen the jinja2 package is installed, Dynaconf evaluates template expressions embedded in configuration values without a sandboxed environment.\n\nIf an attacker can influence configuration sources such as:\nenvironment variables\n.env files\ncontainer environment configuration\nCI/CD secrets\nthey can execute arbitrary OS commands on the host system.\nIn addition, the @format resolver allows object graph traversal, which may expose sensitive runtime objects and environment variables.\n\n### Details\nThe vulnerability arises because Dynaconf's string resolvers lack proper security boundaries.\n\n1. @jinja Resolver\nThe @jinja resolver renders templates using full Jinja2 evaluation.\nHowever, the rendering context is not sandboxed, which allows attackers to access Python's internal attributes.\nUsing objects such as cycler, attackers can reach Python's __globals__ and import the os module.\n\nExample attack path\ncycler\n → __init__\n → __globals__\n → os\n → popen()\nThis leads to arbitrary command execution.\n\n2. @format Resolver\nThe @format resolver performs Python string formatting using internal objects.\nThis allows attackers to traverse Python's object graph and access sensitive runtime objects.\nExample traversal:\n{this.__class__.__init__.__globals__[os].environ}\nThis can expose\n- API keys\n- database credentials\n- internal service tokens\n- environment secrets\n\n### PoC\n```\nimport os\nfrom dynaconf import Dynaconf\n# Malicious configuration injection\nos.environ[\"DYNACONF_RCE\"] = \"@jinja {{ cycler.__init__.__globals__.os.popen('id').read() }}\"\nsettings = Dynaconf()\nprint(\"[!] Command Execution Result:\")\nprint(settings.RCE)\n```\n### Impact\nSuccessful exploitation allows attackers to:\n- Execute arbitrary OS commands on the host system\n- Access sensitive environment variables\n- Compromise application secrets\n- Fully compromise the running application process\nBecause configuration values may originate from CI/CD pipelines, container orchestration systems, or environment injection, this vulnerability can become remotely exploitable in real-world deployments.\n\n\n### Remediation / Mitigation (Examples)\n\n1. Use Jinja2 sandbox for template rendering\n```\nfrom jinja2.sandbox import SandboxedEnvironment\nenv = SandboxedEnvironment()\ntemplate = env.from_string(\"{{ config_value }}\")\nsafe_value = template.render(config_value=user_input)```\n```\n2. Restrict @format usage to trusted values\n```\nsafe_value = \"{name}\".format(name=trusted_name)\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "dynaconf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.13"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.2.12"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dynaconf/dynaconf/security/advisories/GHSA-pxrr-hq57-q35p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33154"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dynaconf/dynaconf/commit/2fbb45ee36b8c0caa5b924fe19f3c1a5e8603fa7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dynaconf/dynaconf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dynaconf/dynaconf/releases/tag/3.2.13"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336", "CWE-78", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-18T20:08:06Z",
    "nvd_published_at" : "2026-03-20T21:17:15Z"
  }
}