CVE-2021-43837
Hashicorp Vault vault-cli Jinja2 Template Injection Remote Code Execution
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.
INFO
Published Date :
Dec. 16, 2021, 7:15 p.m.
Last Modified :
Nov. 21, 2024, 6:29 a.m.
Source :
[email protected]
Remotely Exploitable :
Yes !
Impact Score :
6.0
Exploitability Score :
2.3
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2021-43837
.
URL | Resource |
---|---|
https://github.com/peopledoc/vault-cli/commit/3ba3955887fd6b7d4d646c8b260f21cebf5db852 | Patch Third Party Advisory |
https://github.com/peopledoc/vault-cli/security/advisories/GHSA-q34h-97wf-8r8j | Exploit Mitigation Third Party Advisory |
https://podalirius.net/en/publications/grehack-2021-optimizing-ssti-payloads-for-jinja2/ | Exploit Third Party Advisory |
https://github.com/peopledoc/vault-cli/commit/3ba3955887fd6b7d4d646c8b260f21cebf5db852 | Patch Third Party Advisory |
https://github.com/peopledoc/vault-cli/security/advisories/GHSA-q34h-97wf-8r8j | Exploit Mitigation Third Party Advisory |
https://podalirius.net/en/publications/grehack-2021-optimizing-ssti-payloads-for-jinja2/ | Exploit Third Party Advisory |
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2021-43837
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2021-43837
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://github.com/peopledoc/vault-cli/commit/3ba3955887fd6b7d4d646c8b260f21cebf5db852 Added Reference https://github.com/peopledoc/vault-cli/security/advisories/GHSA-q34h-97wf-8r8j Added Reference https://podalirius.net/en/publications/grehack-2021-optimizing-ssti-payloads-for-jinja2/ -
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value -
Reanalysis by [email protected]
Aug. 09, 2022
Action Type Old Value New Value Added CWE NIST CWE-94 -
CPE Deprecation Remap by [email protected]
Feb. 08, 2022
Action Type Old Value New Value Changed CPE Configuration OR *cpe:2.3:a:ukg:vault-cli:*:*:*:*:*:python:*:* versions from (including) 0.7.0 from (excluding) 3.0.0 OR *cpe:2.3:a:vault-cli_project:vault-cli:*:*:*:*:*:python:*:* versions from (including) 0.7.0 from (excluding) 3.0.0 -
Initial Analysis by [email protected]
Dec. 30, 2021
Action Type Old Value New Value Added CVSS V2 NIST (AV:N/AC:L/Au:S/C:C/I:C/A:C) Added CVSS V3.1 NIST AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H Changed Reference Type https://github.com/peopledoc/vault-cli/commit/3ba3955887fd6b7d4d646c8b260f21cebf5db852 No Types Assigned https://github.com/peopledoc/vault-cli/commit/3ba3955887fd6b7d4d646c8b260f21cebf5db852 Patch, Third Party Advisory Changed Reference Type https://github.com/peopledoc/vault-cli/security/advisories/GHSA-q34h-97wf-8r8j No Types Assigned https://github.com/peopledoc/vault-cli/security/advisories/GHSA-q34h-97wf-8r8j Exploit, Mitigation, Third Party Advisory Changed Reference Type https://podalirius.net/en/publications/grehack-2021-optimizing-ssti-payloads-for-jinja2/ No Types Assigned https://podalirius.net/en/publications/grehack-2021-optimizing-ssti-payloads-for-jinja2/ Exploit, Third Party Advisory Added CPE Configuration OR *cpe:2.3:a:ukg:vault-cli:*:*:*:*:*:python:*:* versions from (including) 0.7.0 up to (excluding) 3.0.0
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2021-43837
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2021-43837
weaknesses.
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
9.55 }} -3.22%
score
0.92106
percentile