cve.bz

CVE-2021-43837 vault-cli project vault-cli: Code Injection

9.1 criticalExploit referenceEPSS 5.2%Fix available

Critical (9.1) in vault-cli project vault-cli. EPSS 5.2% estimated probability of exploitation activity in the next 30 days. Fixed in vault-cli 3.0.0.

On this page
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.

Severity

CVSS 3.1

9.1 critical
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
EPSS
5.2% (unchanged from 5.2% a week ago; 5.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 93rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-94 Improper Control of Generation of Code (Code Injection)
CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component (Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-43837 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-43837?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-43837?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-43837 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
vault-cli_project:vault-clifrom 0.7.0 before 3.0.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-q34h-97wf-8r8jPyPIvault-cli>=0.7.0 <3.0.03.0.0
PYSEC-2021-853PyPIvault-cli<3.0.03.0.0

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-74 (37).

References

Check your stackJSON