# CVE-2021-43837: Template injection in vault-cli

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.4
- **CVSS:** 8.4 (v3.1, CNA) `CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Adjacent network; Attack complexity: Low; Privileges required: High; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 5.17% (percentile 93, 2026-11-26)
- **CWE:** CWE-74
- **Aliases:** GHSA-q34h-97wf-8r8j, PYSEC-2021-853
- **Published:** 2021-12-16T18:55:14.000Z
- **Modified:** 2026-07-08T06:28:15.882Z

## Who should check

- Projects that depend on PyPI package vault-cli (\>= 0.7.0, \< 3.0.0)
- Anyone running peopledoc vault-cli \>= 0.7.0,\< 3.0.0

## Description

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.

## Affected and fixed versions

- PyPI `vault-cli`: affected \>= 0.7.0, \< 3.0.0; fixed 3.0.0 (osv)
- peopledoc vault-cli: \>= 0.7.0,\< 3.0.0 (cvelist)

## Mitigation

- Upgrade vault-cli to 3.0.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-43837. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-43837.md
Affected: vault-cli >= 0.7.0, < 3.0.0
Fixed in: 3.0.0

Steps:
1. Search this machine and project for vault-cli (PyPI), peopledoc vault-cli: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-43837 being exploited?

There is no confirmed exploitation: CVE-2021-43837 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 5.17% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-43837?

High: CVSS 8.4 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-43837?

vault-cli \>= 0.7.0, \< 3.0.0.

### Is there a fix for CVE-2021-43837?

Yes. Fixed in 3.0.0. Upgrade vault-cli to 3.0.0 or later.

### How do I check if I'm affected by CVE-2021-43837?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/peopledoc/vault-cli/security/advisories/GHSA-q34h-97wf-8r8j>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-43837>
- patch: <https://github.com/peopledoc/vault-cli/commit/3ba3955887fd6b7d4d646c8b260f21cebf5db852>
- patch: <https://github.com/peopledoc/vault-cli/pull/198>
- exploit: <https://podalirius.net/en/publications/grehack-2021-optimizing-ssti-payloads-for-jinja2/>
- other: <https://github.com/peopledoc/vault-cli>
- other: <https://github.com/peopledoc/vault-cli/releases/tag/3.0.0>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/vault-cli/PYSEC-2021-853.yaml>
- other: <https://podalirius.net/en/publications/grehack-2021-optimizing-ssti-payloads-for-jinja2>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-43837>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-q34h-97wf-8r8j> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2021-853> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-43837> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-43837>
