CVE-2018-10875
Description
A flaw was found in ansible. ansible.cfg is read from the current working directory which can be altered to make it point to a plugin or a module path under the control of an attacker, thus allowing the attacker to execute arbitrary code.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Ansible loads ansible.cfg from the current working directory, allowing local attackers to execute arbitrary code by controlling plugin/module paths.
Vulnerability
A flaw in Ansible allows the configuration file ansible.cfg to be read from the current working directory when executing ad-hoc commands or playbooks. This behavior can be exploited if an attacker places a malicious ansible.cfg in a directory where a victim runs Ansible, pointing to attacker-controlled plugin or module paths. Affected versions include Ansible prior to the security updates that restrict configuration loading from world-writable directories [1][2].
Exploitation
An attacker with local access to a system can create a crafted ansible.cfg in a directory where a victim later executes an Ansible command. The attacker does not require any special privileges beyond write access to that directory. When the victim runs Ansible in that directory, the malicious configuration causes Ansible to load plugins or modules from attacker-controlled paths, leading to arbitrary code execution [1][3].
Impact
Successful exploitation allows the attacker to execute arbitrary code with the privileges of the user running Ansible. This can result in information disclosure, privilege escalation, or full system compromise, depending on the context [1][3].
Mitigation
The vulnerability is fixed in Ansible 2.5.5 and later, and in corresponding updates from vendors such as Red Hat and Ubuntu [2][4]. Users should update to the latest version. As a workaround, ensure that Ansible is not executed in directories writable by untrusted users, and consider using a dedicated configuration file location via the ANSIBLE_CONFIG environment variable.
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
ansiblePyPI | < 2.4.6.0 | 2.4.6.0 |
ansiblePyPI | >= 2.5.0a1, < 2.5.6 | 2.5.6 |
ansiblePyPI | >= 2.6.0a1, < 2.6.1 | 2.6.1 |
Affected products
148- ghsa-coords148 versionspkg:pypi/ansiblepkg:rpm/opensuse/ansible-10&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/ansible-11&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/ansible-12&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/ansible-9&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/ansible&distro=openSUSE%20Leap%2015.0pkg:rpm/opensuse/ansible&distro=openSUSE%20Leap%2015.3pkg:rpm/suse/ansible&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/ansible&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/ansible&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/ansible&distro=SUSE%20Package%20Hub%2012pkg:rpm/suse/ansible&distro=SUSE%20Package%20Hub%2015pkg:rpm/suse/ansible&distro=SUSE%20Package%20Hub%2015%20SP3pkg:rpm/suse/ardana-ansible&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/ardana-ansible&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/ardana-cinder&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/ardana-cinder&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/ardana-glance&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/ardana-glance&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/ardana-mq&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/ardana-mq&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/ardana-nova&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/ardana-nova&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/ardana-osconfig&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/ardana-osconfig&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/crowbar-core&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/crowbar-openstack&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/documentation-hpe-helion-openstack-installation&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/documentation-hpe-helion-openstack-operations&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/documentation-hpe-helion-openstack-opsconsole&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/documentation-hpe-helion-openstack-planning&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/documentation-hpe-helion-openstack-security&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/documentation-hpe-helion-openstack-user&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/documentation-suse-openstack-cloud-deployment&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/documentation-suse-openstack-cloud-installation&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/documentation-suse-openstack-cloud-operations&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/documentation-suse-openstack-cloud-opsconsole&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/documentation-suse-openstack-cloud-planning&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/documentation-suse-openstack-cloud-security&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/documentation-suse-openstack-cloud-supplement&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/documentation-suse-openstack-cloud-supplement&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/documentation-suse-openstack-cloud-upstream-admin&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/documentation-suse-openstack-cloud-upstream-admin&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/documentation-suse-openstack-cloud-upstream-user&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/documentation-suse-openstack-cloud-upstream-user&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/documentation-suse-openstack-cloud-user&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/grafana&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/grafana&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/grafana&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/grafana-natel-discrete-panel&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/grafana-natel-discrete-panel&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/grafana-natel-discrete-panel&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/openstack-cinder&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/openstack-cinder&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/openstack-cinder&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/openstack-cinder-doc&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/openstack-cinder-doc&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/openstack-cinder-doc&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/openstack-monasca-installer&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/openstack-monasca-installer&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/openstack-monasca-installer&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/openstack-neutron&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/openstack-neutron&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/openstack-neutron&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/openstack-neutron-doc&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/openstack-neutron-doc&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/openstack-neutron-doc&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/openstack-nova&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/openstack-nova&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/openstack-nova&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/openstack-nova-doc&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/openstack-nova-doc&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/openstack-nova-doc&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/python-ardana-packager&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/python-ardana-packager&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-Django&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/python-Django&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-Django&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/python-Flask-Cors&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/python-Flask-Cors&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-keystoneclient&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/python-keystoneclient&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-keystoneclient&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/python-keystonemiddleware&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/python-keystonemiddleware&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-keystonemiddleware&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/python-kombu&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/python-kombu&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-kombu&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/python-Pillow&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/python-Pillow&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-Pillow&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/python-straight-plugin&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-straight-plugin&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/python-urllib3&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/python-urllib3&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/python-urllib3&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/release-notes-hpe-helion-openstack&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/release-notes-suse-openstack-cloud&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/release-notes-suse-openstack-cloud&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/rubygem-crowbar-client&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/storm&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/storm&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/storm&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/venv-openstack-aodh&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-aodh&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-barbican&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-barbican&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-ceilometer&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-ceilometer&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-cinder&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-cinder&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-designate&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-designate&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-freezer&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-freezer&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-glance&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-glance&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-heat&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-heat&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-horizon&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-horizon-hpe&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-ironic&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-ironic&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-keystone&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-keystone&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-magnum&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-magnum&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-manila&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-manila&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-monasca-ceilometer&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-monasca-ceilometer&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-monasca&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-monasca&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-murano&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-murano&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-neutron&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-neutron&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-nova&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-nova&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-octavia&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-octavia&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-sahara&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-sahara&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-swift&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-swift&distro=SUSE%20OpenStack%20Cloud%208pkg:rpm/suse/venv-openstack-trove&distro=HPE%20Helion%20OpenStack%208pkg:rpm/suse/venv-openstack-trove&distro=SUSE%20OpenStack%20Cloud%208
< 2.4.6.0+ 147 more
- (no CPE)range: < 2.4.6.0
- (no CPE)range: < 10.6.0-1.1
- (no CPE)range: < 11.11.0-1.1
- (no CPE)range: < 12.2.0-1.1
- (no CPE)range: < 9.8.0-1.1
- (no CPE)range: < 2.7.8-bp150.3.6.1
- (no CPE)range: < 2.9.21-bp153.2.3.1
- (no CPE)range: < 2.4.6.0-3.3.1
- (no CPE)range: < 2.4.6.0-3.3.1
- (no CPE)range: < 2.4.6.0-3.3.1
- (no CPE)range: < 2.7.8-bp150.3.6.1
- (no CPE)range: < 2.7.8-bp150.3.6.1
- (no CPE)range: < 2.9.21-bp153.2.3.1
- (no CPE)range: < 8.0+git.1596735237.54109b1-3.77.1
- (no CPE)range: < 8.0+git.1596735237.54109b1-3.77.1
- (no CPE)range: < 8.0+git.1596129856.263f430-3.43.1
- (no CPE)range: < 8.0+git.1596129856.263f430-3.43.1
- (no CPE)range: < 8.0+git.1593631779.76fa9b7-3.24.1
- (no CPE)range: < 8.0+git.1593631779.76fa9b7-3.24.1
- (no CPE)range: < 8.0+git.1593618123.678c32b-3.26.1
- (no CPE)range: < 8.0+git.1593618123.678c32b-3.26.1
- (no CPE)range: < 8.0+git.1601298847.dd01585-3.42.1
- (no CPE)range: < 8.0+git.1601298847.dd01585-3.42.1
- (no CPE)range: < 8.0+git.1595885113.93abcbc-3.49.1
- (no CPE)range: < 8.0+git.1595885113.93abcbc-3.49.1
- (no CPE)range: < 5.0+git.1600432272.b3ad722f0-3.44.1
- (no CPE)range: < 5.0+git.1599037158.5c4d07480-4.43.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 8.20201007-1.29.1
- (no CPE)range: < 6.7.4-4.12.1
- (no CPE)range: < 6.7.4-4.12.1
- (no CPE)range: < 6.7.4-4.12.1
- (no CPE)range: < 0.0.9-3.3.6
- (no CPE)range: < 0.0.9-3.3.6
- (no CPE)range: < 0.0.9-3.3.6
- (no CPE)range: < 11.2.3~dev29-3.28.2
- (no CPE)range: < 11.2.3~dev29-3.28.2
- (no CPE)range: < 11.2.3~dev29-3.28.2
- (no CPE)range: < 11.2.3~dev29-3.28.1
- (no CPE)range: < 11.2.3~dev29-3.28.1
- (no CPE)range: < 11.2.3~dev29-3.28.1
- (no CPE)range: < 20190923_16.32-3.15.1
- (no CPE)range: < 20190923_16.32-3.15.1
- (no CPE)range: < 20190923_16.32-3.15.1
- (no CPE)range: < 11.0.9~dev69-3.37.2
- (no CPE)range: < 11.0.9~dev69-3.37.2
- (no CPE)range: < 11.0.9~dev69-3.37.2
- (no CPE)range: < 11.0.9~dev69-3.37.1
- (no CPE)range: < 11.0.9~dev69-3.37.1
- (no CPE)range: < 11.0.9~dev69-3.37.1
- (no CPE)range: < 16.1.9~dev76-3.39.2
- (no CPE)range: < 16.1.9~dev76-3.39.2
- (no CPE)range: < 16.1.9~dev76-3.39.2
- (no CPE)range: < 16.1.9~dev76-3.39.1
- (no CPE)range: < 16.1.9~dev76-3.39.1
- (no CPE)range: < 16.1.9~dev76-3.39.1
- (no CPE)range: < 0.0.3-7.7.2
- (no CPE)range: < 0.0.3-7.7.2
- (no CPE)range: < 1.11.29-3.19.2
- (no CPE)range: < 1.11.29-3.19.2
- (no CPE)range: < 1.11.29-3.19.2
- (no CPE)range: < 3.0.3-3.3.1
- (no CPE)range: < 3.0.3-3.3.1
- (no CPE)range: < 3.13.1-3.3.2
- (no CPE)range: < 3.13.1-3.3.2
- (no CPE)range: < 3.13.1-3.3.2
- (no CPE)range: < 4.17.1-5.3.1
- (no CPE)range: < 4.17.1-5.3.1
- (no CPE)range: < 4.17.1-5.3.1
- (no CPE)range: < 4.1.0-3.7.1
- (no CPE)range: < 4.1.0-3.7.1
- (no CPE)range: < 4.1.0-3.7.1
- (no CPE)range: < 4.2.1-3.9.2
- (no CPE)range: < 4.2.1-3.9.2
- (no CPE)range: < 4.2.1-3.9.2
- (no CPE)range: < 1.5.0-1.3.1
- (no CPE)range: < 1.5.0-1.3.1
- (no CPE)range: < 1.22-5.12.1
- (no CPE)range: < 1.22-5.12.1
- (no CPE)range: < 1.22-5.12.1
- (no CPE)range: < 8.20200922-3.23.1
- (no CPE)range: < 8.20200922-3.23.1
- (no CPE)range: < 8.20200922-3.23.1
- (no CPE)range: < 3.9.3-1.1
- (no CPE)range: < 1.2.3-3.6.1
- (no CPE)range: < 1.2.3-3.6.1
- (no CPE)range: < 1.2.3-3.6.1
- (no CPE)range: < 5.1.1~dev7-12.28.1
- (no CPE)range: < 5.1.1~dev7-12.28.1
- (no CPE)range: < 5.0.2~dev3-12.29.1
- (no CPE)range: < 5.0.2~dev3-12.29.1
- (no CPE)range: < 9.0.8~dev7-12.26.1
- (no CPE)range: < 9.0.8~dev7-12.26.1
- (no CPE)range: < 11.2.3~dev29-14.30.1
- (no CPE)range: < 11.2.3~dev29-14.30.1
- (no CPE)range: < 5.0.3~dev7-12.27.1
- (no CPE)range: < 5.0.3~dev7-12.27.1
- (no CPE)range: < 5.0.0.0~xrc2~dev2-10.24.1
- (no CPE)range: < 5.0.0.0~xrc2~dev2-10.24.1
- (no CPE)range: < 15.0.3~dev3-12.27.1
- (no CPE)range: < 15.0.3~dev3-12.27.1
- (no CPE)range: < 9.0.8~dev22-12.29.1
- (no CPE)range: < 9.0.8~dev22-12.29.1
- (no CPE)range: < 12.0.5~dev3-14.32.1
- (no CPE)range: < 12.0.5~dev3-14.32.1
- (no CPE)range: < 9.1.8~dev8-12.29.1
- (no CPE)range: < 9.1.8~dev8-12.29.1
- (no CPE)range: < 12.0.4~dev11-11.30.1
- (no CPE)range: < 12.0.4~dev11-11.30.1
- (no CPE)range: < 5.0.2_5.0.2_5.0.2~dev31-11.28.1
- (no CPE)range: < 5.0.2_5.0.2_5.0.2~dev31-11.28.1
- (no CPE)range: < 5.1.1~dev5-12.33.1
- (no CPE)range: < 5.1.1~dev5-12.33.1
- (no CPE)range: < 1.5.1_1.5.1_1.5.1~dev3-8.24.1
- (no CPE)range: < 1.5.1_1.5.1_1.5.1~dev3-8.24.1
- (no CPE)range: < 2.2.2~dev1-11.24.1
- (no CPE)range: < 2.2.2~dev1-11.24.1
- (no CPE)range: < 4.0.2~dev2-12.24.1
- (no CPE)range: < 4.0.2~dev2-12.24.1
- (no CPE)range: < 11.0.9~dev69-13.32.1
- (no CPE)range: < 11.0.9~dev69-13.32.1
- (no CPE)range: < 16.1.9~dev76-11.30.1
- (no CPE)range: < 16.1.9~dev76-11.30.1
- (no CPE)range: < 1.0.6~dev3-12.29.1
- (no CPE)range: < 1.0.6~dev3-12.29.1
- (no CPE)range: < 7.0.5~dev4-11.28.1
- (no CPE)range: < 7.0.5~dev4-11.28.1
- (no CPE)range: < 2.15.2_2.15.2_2.15.2~dev32-11.21.1
- (no CPE)range: < 2.15.2_2.15.2_2.15.2~dev32-11.21.1
- (no CPE)range: < 8.0.2~dev2-11.28.1
- (no CPE)range: < 8.0.2~dev2-11.28.1
Patches
3ff980afefdbe[stable-2.5] ignore ansible.cfg in world writable cwd (#42070) (#42142)
5 files changed · +38 −10
changelogs/fragments/wrcwd_ansible.cfg.yml+2 −0 added@@ -0,0 +1,2 @@ +bugfixes: + - '**Security Fix** - avoid using ansible.cfg in a world writable dir.'
docs/docsite/rst/installation_guide/intro_configuration.rst+2 −2 modified@@ -21,7 +21,7 @@ The stock configuration should be sufficient for most users, but there may be re .. _getting_the_latest_configuration: Getting the latest configuration -================================ +-------------------------------- If installing Ansible from a package manager, the latest ansible.cfg file should be present in /etc/ansible, possibly as a ".rpmnew" file (or other) as appropriate in the case of updates. @@ -35,6 +35,7 @@ For more details and a full listing of available configurations go to :ref:`conf For in-depth details, see :ref:`ansible_configuration_settings`. +.. _environmental_configuration: Environmental configuration =========================== @@ -55,4 +56,3 @@ Settings in the command line will override those passed through the configuratio The full list of options available is in :ref:`ansible-playbook` and :ref:`ansible`. -
docs/templates/man.j2+8 −4 modified@@ -76,17 +76,18 @@ ENVIRONMENT The following environment variables may be specified. {% if inventory %} -ANSIBLE_INVENTORY -- Override the default ansible inventory file +ANSIBLE_INVENTORY -- Override the default ansible inventory sources {% endif %} {% if library %} ANSIBLE_LIBRARY -- Override the default ansible module library path {% endif %} -ANSIBLE_CONFIG -- Override the default ansible config file +ANSIBLE_CONFIG -- Specify override location for the ansible config file Many more are available for most options in ansible.cfg +For a full list check https://docs.ansible.com/. or use the `ansible-config` command. FILES ----- @@ -99,6 +100,9 @@ FILES ~/.ansible.cfg -- User config file, overrides the default config if present +./ansible.cfg -- Local config file (in current working direcotry) assumed to be 'project specific' and overrides the rest if present. + +As mentioned above, the ANSIBLE_CONFIG environment variable will override all others. AUTHOR ------ @@ -109,8 +113,8 @@ Ansible was originally written by Michael DeHaan. COPYRIGHT --------- -Copyright © 2017 Red Hat, Inc | Ansible. -Ansible is released under the terms of the GPLv3 License. +Copyright © 2018 Red Hat, Inc | Ansible. +Ansible is released under the terms of the GPLv3 license. SEE ALSO
lib/ansible/config/manager.py+12 −3 modified@@ -6,6 +6,7 @@ import os import sys +import stat import tempfile from collections import namedtuple @@ -139,7 +140,7 @@ def get_ini_config_value(p, entry): return value -def find_ini_config_file(): +def find_ini_config_file(warnings=None): ''' Load INI Config File order(first found is used): ENV, CWD, HOME, /etc/ansible ''' # FIXME: eventually deprecate ini configs @@ -149,7 +150,14 @@ def find_ini_config_file(): if os.path.isdir(path0): path0 += "/ansible.cfg" try: - path1 = os.getcwd() + "/ansible.cfg" + path1 = os.getcwd() + perms1 = os.stat(path1) + if perms1.st_mode & stat.S_IWOTH: + if warnings is not None: + warnings.add("Ansible is in a world writable directory (%s), ignoring it as an ansible.cfg source." % to_text(path1)) + path1 = None + else: + path1 += "/ansible.cfg" except OSError: path1 = None path2 = unfrackpath("~/.ansible.cfg", follow=False) @@ -168,6 +176,7 @@ class ConfigManager(object): UNABLE = [] DEPRECATED = [] + WARNINGS = set() def __init__(self, conf_file=None, defs_file=None): @@ -193,7 +202,7 @@ def __init__(self, conf_file=None, defs_file=None): if self._config_file is None: # set config using ini - self._config_file = find_ini_config_file() + self._config_file = find_ini_config_file(self.WARNINGS) # consume configuration if self._config_file:
lib/ansible/constants.py+14 −1 modified@@ -17,14 +17,24 @@ from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value +def _warning(msg): + ''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write ''' + try: + from __main__ import display + display.warning(msg) + except: + import sys + sys.stderr.write(' [WARNING] %s\n' % (msg)) + + def _deprecated(msg, version='2.8'): ''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write ''' try: from __main__ import display display.deprecated(msg, version=version) except: import sys - sys.stderr.write('[DEPRECATED] %s, to be removed in %s' % (msg, version)) + sys.stderr.write(' [DEPRECATED] %s, to be removed in %s\n' % (msg, version)) def mk_boolean(value): @@ -186,3 +196,6 @@ def set_constant(name, value, export=vars()): value = ensure_type(value, setting.name) set_constant(setting.name, value) + +for warn in config.WARNINGS: + _warning(warn)
f32c42c37aaf[stable-2.4] ignore ansible.cfg in world writable cwd (#42070)
4 files changed · +35 −7
CHANGELOG.md+2 −0 modified@@ -8,6 +8,8 @@ Ansible Changes By Release ### Bugfixes * **Security Fix** - avoid loading host/group vars from cwd when not specifying a playbook or playbook base dir (https://github.com/ansible/ansible/pull/42067) +* **Security Fix** - avoid using ansible.cfg in a world readable dir + https://github.com/ansible/ansible/pull/42070 <a id="2.4.5"></a>
docs/templates/man.j2+8 −4 modified@@ -76,17 +76,18 @@ ENVIRONMENT The following environment variables may be specified. {% if inventory %} -ANSIBLE_INVENTORY -- Override the default ansible inventory file +ANSIBLE_INVENTORY -- Override the default ansible inventory sources {% endif %} {% if library %} ANSIBLE_LIBRARY -- Override the default ansible module library path {% endif %} -ANSIBLE_CONFIG -- Override the default ansible config file +ANSIBLE_CONFIG -- Specify override location for the ansible config file Many more are available for most options in ansible.cfg +For a full list check https://docs.ansible.com/. or use the `ansible-config` command. FILES ----- @@ -99,6 +100,9 @@ FILES ~/.ansible.cfg -- User config file, overrides the default config if present +./ansible.cfg -- Local config file (in current working direcotry) assumed to be 'project specific' and overrides the rest if present. + +As mentioned above, the ANSIBLE_CONFIG environment variable will override all others. AUTHOR ------ @@ -110,8 +114,8 @@ See the AUTHORS file for a complete list of contributors. COPYRIGHT --------- -Copyright © 2017 Red Hat, Inc | Ansible. -Ansible is released under the terms of the GPLv3 License. +Copyright © 2018 Red Hat, Inc | Ansible. +Ansible is released under the terms of the GPLv3 license. SEE ALSO
lib/ansible/config/manager.py+12 −3 modified@@ -7,6 +7,7 @@ import os import sys +import stat import tempfile import yaml @@ -134,7 +135,7 @@ def get_ini_config_value(p, entry): return value -def find_ini_config_file(): +def find_ini_config_file(warnings=None): ''' Load INI Config File order(first found is used): ENV, CWD, HOME, /etc/ansible ''' # FIXME: eventually deprecate ini configs @@ -144,7 +145,14 @@ def find_ini_config_file(): if os.path.isdir(path0): path0 += "/ansible.cfg" try: - path1 = os.getcwd() + "/ansible.cfg" + path1 = os.getcwd() + perms1 = os.stat(path1) + if perms1.st_mode & stat.S_IWOTH: + if warnings is not None: + warnings.add("Ansible is in a world writable directory (%s), ignoring it as an ansible.cfg source." % to_text(path1)) + path1 = None + else: + path1 += "/ansible.cfg" except OSError: path1 = None path2 = unfrackpath("~/.ansible.cfg", follow=False) @@ -163,6 +171,7 @@ class ConfigManager(object): UNABLE = [] DEPRECATED = [] + WARNINGS = set() def __init__(self, conf_file=None): @@ -184,7 +193,7 @@ def __init__(self, conf_file=None): if self._config_file is None: # set config using ini - self._config_file = find_ini_config_file() + self._config_file = find_ini_config_file(self.WARNINGS) if self._config_file: if os.path.exists(self._config_file):
lib/ansible/constants.py+13 −0 modified@@ -18,6 +18,16 @@ from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value +def _warning(msg): + ''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write ''' + try: + from __main__ import display + display.warning(msg) + except: + import sys + sys.stderr.write(' [WARNING] %s\n' % (msg)) + + def _deprecated(msg): ''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write ''' try: @@ -122,3 +132,6 @@ def set_constant(name, value, export=vars()): value = ensure_type(value, setting.name) set_constant(setting.name, value) + +for warn in config.WARNINGS: + _warning(warn)
4cecbe81adbc[stable-2.6] ignore ansible.cfg in world writable cwd (#42070)
5 files changed · +38 −10
changelogs/fragments/wrcwd_ansible.cfg.yml+2 −0 added@@ -0,0 +1,2 @@ +bugfixes: + - '**Security Fix** - avoid using ansible.cfg in a world writable dir.'
docs/docsite/rst/installation_guide/intro_configuration.rst+2 −2 modified@@ -22,7 +22,7 @@ Paths where configuration file is searched are listed in :ref:`reference documen .. _getting_the_latest_configuration: Getting the latest configuration -================================ +-------------------------------- If installing Ansible from a package manager, the latest ansible.cfg file should be present in /etc/ansible, possibly as a ".rpmnew" file (or other) as appropriate in the case of updates. @@ -36,6 +36,7 @@ For more details and a full listing of available configurations go to :ref:`conf For in-depth details, see :ref:`ansible_configuration_settings`. +.. _environmental_configuration: Environmental configuration =========================== @@ -56,4 +57,3 @@ Settings in the command line will override those passed through the configuratio The full list of options available is in :ref:`ansible-playbook` and :ref:`ansible`. -
docs/templates/man.j2+8 −4 modified@@ -76,17 +76,18 @@ ENVIRONMENT The following environment variables may be specified. {% if inventory %} -ANSIBLE_INVENTORY -- Override the default ansible inventory file +ANSIBLE_INVENTORY -- Override the default ansible inventory sources {% endif %} {% if library %} ANSIBLE_LIBRARY -- Override the default ansible module library path {% endif %} -ANSIBLE_CONFIG -- Override the default ansible config file +ANSIBLE_CONFIG -- Specify override location for the ansible config file Many more are available for most options in ansible.cfg +For a full list check https://docs.ansible.com/. or use the `ansible-config` command. FILES ----- @@ -99,6 +100,9 @@ FILES ~/.ansible.cfg -- User config file, overrides the default config if present +./ansible.cfg -- Local config file (in current working direcotry) assumed to be 'project specific' and overrides the rest if present. + +As mentioned above, the ANSIBLE_CONFIG environment variable will override all others. AUTHOR ------ @@ -109,8 +113,8 @@ Ansible was originally written by Michael DeHaan. COPYRIGHT --------- -Copyright © 2017 Red Hat, Inc | Ansible. -Ansible is released under the terms of the GPLv3 License. +Copyright © 2018 Red Hat, Inc | Ansible. +Ansible is released under the terms of the GPLv3 license. SEE ALSO
lib/ansible/config/manager.py+12 −3 modified@@ -6,6 +6,7 @@ import os import sys +import stat import tempfile from collections import namedtuple @@ -141,7 +142,7 @@ def get_ini_config_value(p, entry): return value -def find_ini_config_file(): +def find_ini_config_file(warnings=None): ''' Load INI Config File order(first found is used): ENV, CWD, HOME, /etc/ansible ''' # FIXME: eventually deprecate ini configs @@ -151,7 +152,14 @@ def find_ini_config_file(): if os.path.isdir(path0): path0 += "/ansible.cfg" try: - path1 = os.getcwd() + "/ansible.cfg" + path1 = os.getcwd() + perms1 = os.stat(path1) + if perms1.st_mode & stat.S_IWOTH: + if warnings is not None: + warnings.add("Ansible is in a world writable directory (%s), ignoring it as an ansible.cfg source." % to_text(path1)) + path1 = None + else: + path1 += "/ansible.cfg" except OSError: path1 = None path2 = unfrackpath("~/.ansible.cfg", follow=False) @@ -170,6 +178,7 @@ class ConfigManager(object): UNABLE = {} DEPRECATED = [] + WARNINGS = set() def __init__(self, conf_file=None, defs_file=None): @@ -195,7 +204,7 @@ def __init__(self, conf_file=None, defs_file=None): if self._config_file is None: # set config using ini - self._config_file = find_ini_config_file() + self._config_file = find_ini_config_file(self.WARNINGS) # consume configuration if self._config_file:
lib/ansible/constants.py+14 −1 modified@@ -17,14 +17,24 @@ from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value +def _warning(msg): + ''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write ''' + try: + from __main__ import display + display.warning(msg) + except: + import sys + sys.stderr.write(' [WARNING] %s\n' % (msg)) + + def _deprecated(msg, version='2.8'): ''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write ''' try: from __main__ import display display.deprecated(msg, version=version) except: import sys - sys.stderr.write('[DEPRECATED] %s, to be removed in %s' % (msg, version)) + sys.stderr.write(' [DEPRECATED] %s, to be removed in %s\n' % (msg, version)) def mk_boolean(value): @@ -189,3 +199,6 @@ def set_constant(name, value, export=vars()): value = ensure_type(value, setting.type) set_constant(setting.name, value) + +for warn in config.WARNINGS: + _warning(warn)
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
25- lists.opensuse.org/opensuse-security-announce/2019-04/msg00021.htmlghsavendor-advisoryx_refsource_SUSEWEB
- access.redhat.com/errata/RHBA-2018:3788ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:2150ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:2151ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:2152ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:2166ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:2321ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2018:2585ghsavendor-advisoryx_refsource_REDHATWEB
- access.redhat.com/errata/RHSA-2019:0054ghsavendor-advisoryx_refsource_REDHATWEB
- github.com/advisories/GHSA-fc4h-467w-46rhghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2018-10875ghsaADVISORY
- usn.ubuntu.com/4072-1/mitrevendor-advisoryx_refsource_UBUNTU
- www.debian.org/security/2019/dsa-4396ghsavendor-advisoryx_refsource_DEBIANWEB
- www.securitytracker.com/id/1041396mitrevdb-entryx_refsource_SECTRACK
- bugzilla.redhat.com/show_bug.cgighsax_refsource_CONFIRMWEB
- github.com/ansible/ansible/commit/4cecbe81adbc655d7ab734165d3ac539f8ba5981ghsaWEB
- github.com/ansible/ansible/commit/f32c42c37aaf7b9db93ea3151b2f42a0c4bd8172ghsaWEB
- github.com/ansible/ansible/commit/ff980afefdbe4ceb828bdb1bb2eef03cf616bf63ghsaWEB
- github.com/ansible/ansible/issues/42388ghsaWEB
- github.com/ansible/ansible/pull/42070ghsaWEB
- github.com/ansible/ansible/pull/43583ghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-43.yamlghsaWEB
- lists.debian.org/debian-lts-announce/2019/09/msg00016.htmlghsamailing-listx_refsource_MLISTWEB
- usn.ubuntu.com/4072-1ghsaWEB
- web.archive.org/web/20201130165946/http://www.securitytracker.com/id/1041396ghsaWEB
News mentions
0No linked articles in our index yet.