Ansible Arbitrary Code Execution
Published 14 May 2022 · Updated 3 Sept 2024
Is your project on an affected ansible?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <1.6.6
- Fixed in
- 1.6.6
pip install 'ansible>=1.6.6'Details
User module in ansible before 1.6.6 is vulnerable to command execution. Ansible can get the result of remote command in variable, which may come from untrusted source of input. If the content of variable isn't properly filtered and when attempting to use the variable, it will trigger a function that passes it through jinja 2 template engine that can result into arbitrary command execution. Under certain circumstances, unprivileged user on system that is being managed via ansible can execute code on the managing host under UID of running ansible process.
Is GHSA-4cvm-5776-jx9f in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected ansible, and gives you the command that fixes it.
More advisories for ansible
- MediumCVE-2025-14010Ansible Community General Collection is vulnerable to exposure of sensitive information · 4 Dec 2025
- MediumCVE-2020-25635Ansible does not collect garbage after playbook run · 31 Oct 2025
- MediumCVE-2023-5115Ansible symlink attack vulnerability · 28 Dec 2023
- HighCVE-2022-3697Ansible leaks password to logs · 28 Oct 2022
- HighCVE-2021-20228Ansible Exposes Sensitive Information · 25 May 2022
- CriticalCVE-2014-4678Ansible Code Injection Vulnerability · 24 May 2022
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.