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

Medium 6.3 Published Updated

An unprivileged user can overwrite arbitrary files and take ownership when a privileged user runs the Ansible user module against their home directory.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-9902?

CVE-2024-9902 is a medium-severity missing authorization vulnerability in Red Hat Ansible Automation Platform Execution Environments, published on 6 Nov 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-863

Which versions are affected by CVE-2024-9902?

11 open source packages ship an affected version, including ansible-core.

PackageAffectedFixed in
ansible-core PyPIAll versions2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2
ansible-core PyPIAll versions2.14.18rc1
ansible-core PyPIAll versions2.14.18rc1
ansible-core PyPIFrom 2.15.0b12.15.13rc1
ansible-core PyPIFrom 2.15.0b12.15.13rc1
ansible-core PyPIFrom 2.16.0b12.16.13rc1
5 more packages
ansible-core PyPIFrom 2.16.0b12.16.13rc1
ansible-core PyPIFrom 2.17.0b12.17.6rc1
ansible-core PyPIFrom 2.17.0b12.17.6rc1
ansible-core PyPIFrom 2.18.0b12.18.0rc2
ansible-core PyPIFrom 2.18.0b12.18.0rc2

How do I fix CVE-2024-9902?

Upgrade ansible-core to a fixed version for your release line: 2.14.18rc1, 2.15.13rc1, 2.16.13rc1 or 2.17.6rc1.

Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.

Is CVE-2024-9902 being exploited?

There is no known exploitation of CVE-2024-9902 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as AZL-52384, AZL-52417, DEBIAN-CVE-2024-9902, GHSA-32p4-gm2c-wmch, PYSEC-2026-1121, UBUNTU-CVE-2024-9902.

Is CVE-2024-9902 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free