Back

MEDIUM

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

Published Nov 6, 2024

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

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)

Change history (0)

No recorded changes yet.

Sources
CVE.org / MITRE
Status PUBLISHED
Assigner redhat
Published Nov 6, 2024
Updated Nov 6, 2025
Reserved Oct 12, 2024
CISA Vulnrichment
Updated Nov 6, 2024
NVD
Status Deferred
Modified Jun 17, 2026
Red Hat
Severity Moderate
Public date Nov 6, 2024
GHSA-32P4-GM2C-WMCH