{"answers":{"affected":"3 open source packages ship an affected version, including vault-cli. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-43837 in the wild and no public exploit code.","fix":"Upgrade vault-cli to 3.0.0 or later.","what":"CVE-2021-43837 is a high-severity code injection vulnerability in peopledoc vault-cli, published on 16 Dec 2021. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-43837 and fix it if it is affected.\n\nWhat it is: CVE-2021-43837 is a high-severity code injection vulnerability in peopledoc vault-cli, published on 16 Dec 2021. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-43837 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- vault-cli (PyPI): affected all versions; fixed in 3.0.0\n- vault-cli (PyPI): affected from 0.7.0; fixed in 3.0.0\n- vault-cli (PyPI): affected from 0.7.0; fixed in 3.0.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-43837/ (Markdown: https://insights.sbomify.com/CVE-2021-43837/index.md)","id":"CVE-2021-43837","markdown":"https://insights.sbomify.com/CVE-2021-43837/index.md","name":"CVE-2021-43837","record":{"aliases":["GHSA-q34h-97wf-8r8j","PYSEC-2021-853"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python CLI tool","requires_auth":"high_privilege","summary":"Attackers can execute arbitrary code via Jinja2 template injection in vault-cli if they control secret values, requiring an upgrade or disabling rendering.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"vault-cli","vendor":"vault-cli_project"}],"cvss":{"score":8.4,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Template injection in vault-cli","id":"CVE-2021-43837","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2021"},"n_packages":3,"n_references":3,"next":{"headline":"Regular Expression Denial of Service (ReDoS) in jsx-slack","id":"CVE-2021-43838"},"packages":[{"ecosystem":"PyPI","fixed":["3.0.0"],"introduced":["0"],"last_affected":[],"package":"vault-cli","purl":"pkg:pypi/vault-cli","source":"PYSEC-2021-853"},{"ecosystem":"PyPI","fixed":["3.0.0"],"introduced":["0.7.0"],"last_affected":[],"package":"vault-cli","purl":null,"source":"GHSA-q34h-97wf-8r8j"},{"ecosystem":"PyPI","fixed":["3.0.0"],"introduced":["0.7.0"],"last_affected":[],"package":"vault-cli","purl":"pkg:pypi/vault-cli","source":"GHSA-q34h-97wf-8r8j"}],"prev":{"headline":"PHP file inclusion in the Sulu admin panel","id":"CVE-2021-43836"},"products":["vault-cli"],"published":"2021-12-16","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-04","vendors":["peopledoc"]},"summary":"Attackers can execute arbitrary code via Jinja2 template injection in vault-cli if they control secret values, requiring an upgrade or disabling rendering.","url":"https://insights.sbomify.com/CVE-2021-43837/"}