GHSA-pxrr-hq57-q35p

Suggest an improvement
Source
https://github.com/advisories/GHSA-pxrr-hq57-q35p
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-pxrr-hq57-q35p/GHSA-pxrr-hq57-q35p.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-pxrr-hq57-q35p
Aliases
Related
Published
2026-03-18T20:08:06Z
Modified
2026-03-20T21:58:37.865377Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
dynaconf Affected by Remote Code Execution (RCE) via Insecure Template Evaluation in @jinja Resolver
Details

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
    
    2. Restrict @format usage to trusted values
    
    safevalue = "{name}".format(name=trustedname) ```
Database specific
{
    "cwe_ids": [
        "CWE-1336",
        "CWE-94"
    ],
    "severity": "HIGH",
    "nvd_published_at": "2026-03-20T21:17:15Z",
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-18T20:08:06Z"
}
References

Affected packages

PyPI / dynaconf

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.2.13

Affected versions

0.*
0.1.0
0.1.1
0.1.2
0.2.0
0.2.1
0.2.2
0.2.3
0.2.4
0.2.5
0.2.6
0.2.8
0.2.9
0.2.10
0.2.11
0.2.12
0.2.13
0.3.0
0.4.0
0.4.1
0.4.2
0.4.3
0.4.4
0.4.5
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.6.0
0.7.0
0.7.1
0.7.2
0.7.3
0.7.4
0.7.5
0.7.6
1.*
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.1.0
1.2.0
1.2.1
2.*
2.0.0
2.0.1
2.0.2
2.0.3
2.0.4
2.1.0
2.1.1
2.2.0
2.2.1
2.2.2
2.2.3
3.*
3.0.0rc1
3.0.0rc2
3.0.0
3.1.0
3.1.1rc1
3.1.1rc2
3.1.1rc3
3.1.1rc4
3.1.1rc5
3.1.1rc6
3.1.1
3.1.2
3.1.3rc1
3.1.3
3.1.4
3.1.5
3.1.7
3.1.8
3.1.9
3.1.10
3.1.11
3.1.12
3.2.0
3.2.1
3.2.2
3.2.3
3.2.4
3.2.5
3.2.6
3.2.7
3.2.8
3.2.9
3.2.10
3.2.11
3.2.12

Database specific

last_known_affected_version_range
"<= 3.2.12"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-pxrr-hq57-q35p/GHSA-pxrr-hq57-q35p.json"