Arbitrary Code Execution Affecting vault-cli package, versions [,3.0.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
5.17% (93rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-VAULTCLI-2321386
  • published17 Dec 2021
  • disclosed17 Dec 2021
  • creditJoachim Jablon

Introduced: 17 Dec 2021

CVE-2021-43837  (opens in a new tab)
CWE-74  (opens in a new tab)

How to fix?

Upgrade vault-cli to version 3.0.0 or higher.

Overview

vault-cli is a Python 3.6+ tool that offers simple interactions to manipulate secrets from Hashicorp Vault.

Affected versions of this package are vulnerable to Arbitrary Code Execution. When a secret starts with the prefix "!template!", vault-cli interprets the rest of the contents of the secret as a Jinja2 template. An attacker controlling a jinja2 template rendered on a machine can trigger arbitrary code.

###Workaround 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.

References

CVSS Base Scores

version 3.1