Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-pxrr-hq57-q35p

Опубликовано: 18 мар. 2026
Источник: github
Github: Прошло ревью
CVSS3: 7.5

Описание

dynaconf Affected by Remote Code Execution (RCE) via Insecure Template Evaluation in @jinja Resolver

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 → initglobals → os → popen() This leads to arbitrary command execution.

  1. @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)```
  1. Restrict @format usage to trusted values
safe_value = "{name}".format(name=trusted_name)

Пакеты

Наименование

dynaconf

pip
Затронутые версииВерсия исправления

<= 3.2.12

3.2.13

EPSS

Процентиль: 41%
0.00526
Низкий

7.5 High

CVSS3

Дефекты

CWE-1336
CWE-78
CWE-94

Связанные уязвимости

CVSS3: 7.5
ubuntu
5 месяцев назад

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.

CVSS3: 7.5
redhat
5 месяцев назад

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.

CVSS3: 7.5
nvd
5 месяцев назад

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.

CVSS3: 7.5
debian
5 месяцев назад

dynaconf is a configuration management tool for Python. Prior to versi ...

suse-cvrf
5 месяцев назад

Security update for python-dynaconf

EPSS

Процентиль: 41%
0.00526
Низкий

7.5 High

CVSS3

Дефекты

CWE-1336
CWE-78
CWE-94