CWE data temporarily unavailableCWE data is currently experiencing intermittent outages, which may cause incomplete section loading on CVE pages. We are actively working on a fix.

CVE-2024-9902

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.

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

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score6.3N/A6.3
Attack VectorLocalN/ALocal
Attack ComplexityHighN/AHigh
Privileges RequiredLowN/ALow
User InteractionRequiredN/ARequired
ScopeUnchangedN/AUnchanged
ConfidentialityHighN/AHigh
Integrity ImpactHighN/AHigh
Availability ImpactLowN/ALow

Vector

Red Hat: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L

cve.org: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:L

Acknowledgements

Red Hat would like to thank Matt Clay for reporting this issue.

Frequently Asked Questions

Want to get errata notifications? Sign up here.