CVE-2019-3828: Path Traversal Vulnerability in Ansible
Summary
CVE-2019-3828: Ansible fetch module before versions 2.5.15, 2.6.14, 2.7.8 has a path traversal vulnerability which allows copying and overwriting files outside of the specified destination in the local ansible controller host, by not r... Affects ansible across 3 version ranges.
>= 2.5.0, < 2.5.15
>= 2.6.0, < 2.6.14
>= 2.7.0, < 2.7.8
Fixed in 2.5.15, 2.6.14 or 2.7.8, depending on the release line you run. How to fix ↓
Also tracked for
- ansible · Alpine:v3.10
The same CVE-2019-3828 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Ansible is an open-source automation tool that allows users to automate IT tasks such as configuration management, application deployment, and orchestration. It is widely used for managing and provisioning infrastructure. The Ansible fetch module is responsible for copying files from remote hosts to the local Ansible controller host. However, versions prior to 2.5.15, 2.6.14, and 2.7.8 have a path traversal vulnerability that allows an attacker to copy and overwrite files outside of the specified destination on the local Ansible controller host. This vulnerability can be exploited by not restricting an absolute path.
Vulnerability Detail
The path traversal vulnerability in the Ansible fetch module allows an attacker to access and modify files outside of the intended destination. By manipulating the file path, an attacker can overwrite critical system files or gain unauthorized access to sensitive information. This can lead to a variety of security issues, including remote code execution, privilege escalation, and data leakage. It is important to note that this vulnerability only affects Ansible versions prior to 2.5.15, 2.6.14, and 2.7.8.
How To Fix
Latest published version: 14.5.0 as of 22 Oct 2026
pip install --upgrade "ansible==14.5.0"
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
>= 2.5.0, < 2.5.152.5.15pip install --upgrade "ansible==2.5.15" -
>= 2.6.0, < 2.6.142.6.14pip install --upgrade "ansible==2.6.14" -
>= 2.7.0, < 2.7.82.7.8pip install --upgrade "ansible==2.7.8"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, users can implement input validation and sanitization to ensure that file paths are restricted to the intended destination. This can be achieved by validating user input and enforcing strict file path restrictions. Here is an example of how to sanitize file paths in Python:
import os
def sanitize_file_path(file_path):
base_path = '/path/to/destination'
sanitized_path = os.path.abspath(os.path.join(base_path, file_path))
if not sanitized_path.startswith(base_path):
raise ValueError('Invalid file path')
return sanitized_path
Conclusion
The path traversal vulnerability in Ansible's fetch module can have serious security implications, allowing attackers to access and modify files outside of the intended destination. It is crucial to upgrade to the latest version of Ansible (2.5.15, 2.6.14, or 2.7.8) to mitigate this vulnerability. Implementing input validation and sanitization can serve as a temporary workaround until the upgrade is performed. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for ansible →
FAQ
The path traversal vulnerability in Ansible's fetch module allows an attacker to access and modify files outside of the intended destination. This can lead to remote code execution, privilege escalation, and data leakage.
Versions prior to 2.5.15, 2.6.14, and 2.7.8 are affected by this vulnerability.
At the time of this advisory, there are no known public exploits targeting this vulnerability. However, it is important to patch your Ansible installation to prevent potential exploitation.
You can use the Vulert playground at Vulert Scanner to check if your Ansible installation is affected by this vulnerability. Simply provide your Pipfile.lock and the playground will analyze it for any open-source vulnerabilities, including CVE-2019-3828.
You can find more information about this vulnerability in the Ansible advisory database at https://github.com/pypa/advisory-database/blob/main/vulns/ansible/PYSEC-2019-5.yaml.
Related vulnerabilities
Recent vulnerabilities recorded for ansible.