Skip to content
Fencer Vulns
high 8.4

CVE-2021-43837 json

Template injection in vault-cli

published 2021-12-16 4 y ago modified 2026-07-08 4 mo ago also GHSA-q34h-97wf-8r8j , PYSEC-2021-853 , EUVD-2021-0458

cvss
8.4
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
5.2%
EPSS 5.2% chance of exploitation in 30 days, percentile 92%
public exploits
0
none known

Summary

vault-cli is a configurable command-line interface tool (and python library) to interact with Hashicorp Vault. In versions before 3.0.0 vault-cli features the ability for rendering templated values. When a secret starts with the prefix `!template!`, vault-cli interprets the rest of the contents of the secret as a Jinja2 template. Jinja2 is a powerful templating engine and is not designed to safely render arbitrary templates. An attacker controlling a jinja2 template rendered on a machine can trigger arbitrary code, making this a Remote Code Execution (RCE) risk. If the content of the vault can be completely trusted, then this is not a problem. Otherwise, if your threat model includes cases where an attacker can manipulate a secret value read from the vault using vault-cli, then this vulnerability may impact you. In 3.0.0, the code related to interpreting vault templated secrets has been removed entirely. Users are advised to upgrade as soon as possible. For users unable to upgrade a workaround does exist. Using the environment variable `VAULT_CLI_RENDER=false` or the flag `--no-render` (placed between `vault-cli` and the subcommand, e.g. `vault-cli --no-render get-all`) or adding `render: false` to the vault-cli configuration yaml file disables rendering and removes the vulnerability. Using the python library, you can use: `vault_cli.get_client(render=False)` when creating your client to get a client that will not render templated secrets and thus operates securely.

Patch / fix

  • pypi vault-cli 3.0.0
  • vault-cli_project vault-cli 3.0.0

Exploit prediction

5.17% chance of exploitation in the next 30 days, higher than 92% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/peopledoc/vault-cli/security/advisories/GHSA-q34h-97wf-8r8j referenced PoC, tagged "exploit" by a source, unverified
  • podalirius.net https://podalirius.net/en/publications/grehack-2021-optimizing-ssti-payloads-for-jinja2/ referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 8.4 CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
NVD 3.1 9.1 CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
NVD 2.0 9.0 AV:N/AC:L/Au:S/C:C/I:C/A:C
GitHub 3.1 8.4 CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
pypi vault-cli
>=0.7.0, <3.0.0
<3.0.0
3.0.0

Affected products

  • peopledoc vault-cli

Classification

Weakness
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component
  • CWE-94 Improper Control of Generation of Code

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.