Ansible-core: ansible-core user may read/write unauthorized content
Published Nov 6, 2024
5.3
MEDIUMCVSS 4.0
EPSS 0.26%
Description
A flaw was found in Ansible. The ansible-core `user` module can allow an unprivileged user to silently create or replace the contents of any file on any system path and take ownership of it when a privileged user executes the `user` module against the unprivileged user's home directory. If the unprivileged user has traversal permissions on the directory containing the exploited target file, they retain full control over the contents of the file as its owner.
Affected products
No data.
No data.
No data.
Ansible Automation Platform Execution Environments
ansible-automation-platform/ansible-builder-rhel8:1.2.0-91
Fixed · RHSA-2024:8969
Ansible Automation Platform Execution Environments
ansible-automation-platform/ansible-builder-rhel9:3.0.1-95
Fixed · RHSA-2024:8969
Ansible Automation Platform Execution Environments
ansible-automation-platform/ee-29-rhel8:2.9.27-32
Fixed · RHSA-2024:8969
Ansible Automation Platform Execution Environments
ansible-automation-platform/ee-minimal-rhel8:2.12.10-54
Fixed · RHSA-2024:8969
Ansible Automation Platform Execution Environments
ansible-automation-platform/ee-minimal-rhel9:2.15.12-17
Fixed · RHSA-2024:8969
Red Hat Ansible Automation Platform 2.4 for RHEL 8
ansible-core-1:2.15.13-1.el8ap
Fixed · RHSA-2024:10762
Red Hat Ansible Automation Platform 2.4 for RHEL 9
ansible-core-1:2.15.13-1.el9ap
Fixed · RHSA-2024:10762
Red Hat Ansible Automation Platform 2.5 for RHEL 8
ansible-core-1:2.16.13-1.el8ap
Fixed · RHSA-2024:9894
Red Hat Ansible Automation Platform 2.5 for RHEL 9
ansible-core-1:2.16.13-1.el9ap
Fixed · RHSA-2024:9894
Red Hat OpenStack Platform 17.1 for RHEL 9
openstack-ansible-core-0:2.14.2-4.6.el9ost
Fixed · RHSA-2025:1861
Red Hat Enterprise Linux 10
ansible-core
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ansible-builder-rhel8:1.2.0-91 | Fixed | RHSA-2024:8969 |
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ansible-builder-rhel9:3.0.1-95 | Fixed | RHSA-2024:8969 |
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ee-29-rhel8:2.9.27-32 | Fixed | RHSA-2024:8969 |
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ee-minimal-rhel8:2.12.10-54 | Fixed | RHSA-2024:8969 |
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ee-minimal-rhel9:2.15.12-17 | Fixed | RHSA-2024:8969 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | ansible-core-1:2.15.13-1.el8ap | Fixed | RHSA-2024:10762 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 9 | ansible-core-1:2.15.13-1.el9ap | Fixed | RHSA-2024:10762 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | ansible-core-1:2.16.13-1.el8ap | Fixed | RHSA-2024:9894 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 9 | ansible-core-1:2.16.13-1.el9ap | Fixed | RHSA-2024:9894 |
| Red Hat OpenStack Platform 17.1 for RHEL 9 | openstack-ansible-core-0:2.14.2-4.6.el9ost | Fixed | RHSA-2025:1861 |
| Red Hat Enterprise Linux 10 | ansible-core | Not affected | n/a |
No package ranges for this CVE.
Remediation
Vendor solution
In the play that uses the user module with the key generation option, have a prior task ensuring the public key does not exist for example:
- name: avoid user exploit (change name depending on other options used in user task) file: path=/home/{{username}}/.ssh/id_rsa.pub state=absent
Red Hat mitigation
In the play that uses the user module with the key generation option, have a prior task ensuring the public key does not exist for example: - name: avoid user exploit (change name depending on other options used in user task) file: path=/home/{{username}}/.ssh/id_rsa.pub state=absent
References (15)
- https://access.redhat.com/errata/RHSA-2024:10762 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2024:8969 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2024:9894 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2025:1861 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2024-9902 vdb-entryx_refsource_REDHATVendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2318271 issue-trackingx_refsource_REDHATIssue Tracking
- https://github.com/advisories/GHSA-32p4-gm2c-wmch Advisory
- https://github.com/ansible/ansible/commit/03794735d370db98a5ec2ad514fab2b0dd22d6be
- https://github.com/ansible/ansible/commit/03daf774d0d80fb7235910ed1c2b4fbcaebdfe65
- https://github.com/ansible/ansible/commit/3b6de811abea0a811e03e3029222a7e459922892
- https://github.com/ansible/ansible/commit/9d7312f695639e804d2caeb1d0f51c716a9ac7dd
- https://github.com/ansible/ansible/commit/f7be90626da3035c697623dcf9c90b7a0bc91c92
- https://lists.debian.org/debian-lts-announce/2024/11/msg00021.html
- https://nvd.nist.gov/vuln/detail/CVE-2024-9902
- https://www.cve.org/CVERecord?id=CVE-2024-9902
Change history (0)
No recorded changes yet.