CVE-2024-9902

Ansible-core: ansible-core user may read/write unauthorized content

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.

Remediation

Workaround:

  • 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

Category

6.3
CVSS
Severity: Medium
CVSS 3.1 •
EPSS 0.03%
Vendor Advisory redhat.com Vendor Advisory redhat.com Vendor Advisory redhat.com Vendor Advisory redhat.com
Affected: Red Hat Ansible Automation Platform Execution Environments
Affected: Red Hat Ansible Automation Platform Execution Environments
Affected: Red Hat Ansible Automation Platform Execution Environments
Affected: Red Hat Ansible Automation Platform Execution Environments
Affected: Red Hat Ansible Automation Platform Execution Environments
Affected: Red Hat Red Hat Ansible Automation Platform 2.4 for RHEL 8
Affected: Red Hat Red Hat Ansible Automation Platform 2.4 for RHEL 9
Affected: Red Hat Red Hat Ansible Automation Platform 2.5 for RHEL 8
Affected: Red Hat Red Hat Ansible Automation Platform 2.5 for RHEL 9
Affected: Red Hat Red Hat OpenStack Platform 17.1 for RHEL 9
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2024-9902?
CVE-2024-9902 has been scored as a medium severity vulnerability.
How to fix CVE-2024-9902?
As a workaround for remediating CVE-2024-9902: 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
Is CVE-2024-9902 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2024-9902 is being actively exploited. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2024-9902?
CVE-2024-9902 affects Red Hat Ansible Automation Platform Execution Environments, Red Hat Ansible Automation Platform Execution Environments, Red Hat Ansible Automation Platform Execution Environments, Red Hat Ansible Automation Platform Execution Environments, Red Hat Ansible Automation Platform Execution Environments, Red Hat Red Hat Ansible Automation Platform 2.4 for RHEL 8, Red Hat Red Hat Ansible Automation Platform 2.4 for RHEL 9, Red Hat Red Hat Ansible Automation Platform 2.5 for RHEL 8, Red Hat Red Hat Ansible Automation Platform 2.5 for RHEL 9, Red Hat Red Hat OpenStack Platform 17.1 for RHEL 9.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.