{"id":"CVE-2026-33154","aliases":["CVE-2026-33154","GHSA-pxrr-hq57-q35p","PYSEC-2026-2147"],"related":[],"kind":"vulnerability","state":"published","title":"dynaconf Affected by Remote Code Execution (RCE) via Insecure Template Evaluation in @jinja Resolver","summary":"dynaconf is a configuration management tool for Python. Prior to version 3.2.13, 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. This issue has been patched in version 3.2.13.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"dynaconf is a configuration management tool for Python. Prior to version 3.2.13, 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. This issue has been patched in version 3.2.13.","source":"cvelist"},{"lang":"en","text":"### 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```","format":"markdown","source":"ghsa"},{"lang":"es","text":"dynaconf es una herramienta de gestión de configuración para Python. Antes de la versión 3.2.13, Dynaconf es vulnerable a la Inyección de Plantilla del Lado del Servidor (SSTI) debido a la evaluación insegura de plantillas en el resolvedor @Jinja. Cuando el paquete jinja2 está instalado, Dynaconf evalúa expresiones de plantilla incrustadas en valores de configuración sin un entorno aislado. Este problema ha sido parcheado en la versión 3.2.13.","source":"nvd"}],"published":"2026-03-18T20:08:06.000Z","modified":"2026-09-10T03:50:40.609Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.1,"rating":"HIGH"}],"cwes":["CWE-78","CWE-94","CWE-1336"],"affected":[{"ranges":[{"version":"< 3.2.13","status":"affected"}],"vendor":"dynaconf","product":"dynaconf","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.2.13"}],"ecosystem":"PyPI","package":"dynaconf","purl":"pkg:pypi/dynaconf","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.2.13"}],"vendor":"dynaconf","product":"dynaconf","cpe":"cpe:2.3:a:dynaconf:dynaconf:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.2.13"}],"ecosystem":"PyPI","package":"dynaconf","purl":"pkg:pypi/dynaconf","source":"pysec"}],"references":[{"url":"https://github.com/dynaconf/dynaconf/security/advisories/GHSA-pxrr-hq57-q35p","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/dynaconf/dynaconf/commit/2fbb45ee36b8c0caa5b924fe19f3c1a5e8603fa7","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/dynaconf/dynaconf/releases/tag/3.2.13","tags":["advisory","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33154","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/dynaconf/dynaconf","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-03-27T15:23:07.114Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33154","url":"https://www.cve.org/CVERecord?id=CVE-2026-33154","licence":"CVE Terms of Use","modified":"2026-03-27T15:23:09.972Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pxrr-hq57-q35p","url":"https://github.com/advisories/GHSA-pxrr-hq57-q35p","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:40.609Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33154","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33154","licence":"Public domain","modified":"2026-06-17T10:37:02.443Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2147","url":"https://osv.dev/vulnerability/PYSEC-2026-2147","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:24.179Z"}],"updatedAt":"2026-11-25T22:59:16.342Z","epss":{"score":0.00585,"percentile":0.49345,"date":"2026-12-01T12:00:22.000Z"}}