---
id: "CVE-2026-123037"
page: "https://infrastack.ai/live/CVE-2026-123037"
kind: "vulnerability"
aliases: ["CVE-2026-123037"]
title: "Ansible-core user module lets local user escalate to root via symlink"
severity: "medium"
cvss: 6.7
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["ansible-core", "linux", "package", "self-hosted"]
not_affected_if: ["generate-ssh-key-disabled", "no-local-untrusted-users"]
published_at: "2026-11-06T06:16:42+00:00"
first_seen_at: "2026-11-06T06:40:12+00:00"
updated_at: "2026-11-06T06:41:34+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-123037", "first_seen_at": "2026-11-06T06:40:12+00:00"}]
exploit_sources: []
---

# Ansible-core user module lets local user escalate to root via symlink

Link for people: https://infrastack.ai/live/CVE-2026-123037 (this .md is for agents)

When the Ansible user module generates SSH keys, it checks the ~/.ssh directory only for existence, not for symlinks. A local unprivileged user on a managed node can redirect the write to a root-writable directory and gain root.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version with `ansible-core --version` on managed nodes and controllers.
- Look for tasks that call the `user` module with `generate_ssh_key: true` in playbooks.

## Timeline

- 2026-11-06T06:40:12+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-123037

## From the sources

A flaw was found in the ansible-core user module. When generate_ssh_key is enabled, User.ssh_key_gen() guards the key files against symlinks but checks the ~/.ssh directory only with os.path.exists(). An unprivileged user on a managed node who replaces their ~/.ssh with a symlink to an existing root-writable directory causes the privileged module to write the generated key pair through the symlink and then chown both files to that user. Because such files can be dropped into directories processed by schedulers (e.g. /etc/cron.daily) or dynamic MOTD (/etc/update-motd.d), the user can escalate to root on the managed node. This is an incomplete fix of CVE-2024-9902.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
