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

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

- **Severity:** Medium 6.3 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L`)
- **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:** Yes
- **Published:** 6 Nov 2024
- **Updated:** 6 Nov 2025
- **Also known as:** AZL-52384, AZL-52417, DEBIAN-CVE-2024-9902, GHSA-32p4-gm2c-wmch, PYSEC-2026-1121, UBUNTU-CVE-2024-9902

## 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 (Incorrect Authorization)

## Which versions are affected by CVE-2024-9902?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ansible-core` | PyPI | All versions | 2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2 |
| `ansible-core` | PyPI | All versions | 2.14.18rc1 |
| `ansible-core` | PyPI | All versions | 2.14.18rc1 |
| `ansible-core` | PyPI | From 2.15.0b1 | 2.15.13rc1 |
| `ansible-core` | PyPI | From 2.15.0b1 | 2.15.13rc1 |
| `ansible-core` | PyPI | From 2.16.0b1 | 2.16.13rc1 |
| `ansible-core` | PyPI | From 2.16.0b1 | 2.16.13rc1 |
| `ansible-core` | PyPI | From 2.17.0b1 | 2.17.6rc1 |
| `ansible-core` | PyPI | From 2.17.0b1 | 2.17.6rc1 |
| `ansible-core` | PyPI | From 2.18.0b1 | 2.18.0rc2 |
| `ansible-core` | PyPI | From 2.18.0b1 | 2.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.

## 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:

- CVE-2026-11837: local privilege escalation in the ansible.posix authorized_key module via symlink-following chown. Technical writeup; sibling of CVE-2024-9902. (github_poc): https://github.com/M8seven/cve-2026-11837-ansible-posix-authorized-key

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-9902 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2024-9902 in the wild and no public exploit code.

Affected packages and fixed versions:
- ansible-core (PyPI): affected all versions; fixed in 2.14.18rc1, 2.15.13rc1, 2.16.13rc1, 2.17.6rc1, 2.18.0rc2
- ansible-core (PyPI): affected all versions; fixed in 2.14.18rc1
- ansible-core (PyPI): affected all versions; fixed in 2.14.18rc1
- ansible-core (PyPI): affected from 2.15.0b1; fixed in 2.15.13rc1
- ansible-core (PyPI): affected from 2.15.0b1; fixed in 2.15.13rc1
- ansible-core (PyPI): affected from 2.16.0b1; fixed in 2.16.13rc1
- ansible-core (PyPI): affected from 2.16.0b1; fixed in 2.16.13rc1
- ansible-core (PyPI): affected from 2.17.0b1; fixed in 2.17.6rc1
- ansible-core (PyPI): affected from 2.17.0b1; fixed in 2.17.6rc1
- ansible-core (PyPI): affected from 2.18.0b1; fixed in 2.18.0rc2
- ansible-core (PyPI): affected from 2.18.0b1; fixed in 2.18.0rc2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-9902/ (Markdown: https://insights.sbomify.com/CVE-2024-9902/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-9902
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-9902
- OSV: https://osv.dev/vulnerability/CVE-2024-9902

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-9902/
Summaries are generated and may contain mistakes; the official description above is the record.
