Fixes the symlink handling issue in the authorized_key module (#760)

- Addresses CVE-2026-11837
- Fixes #759

Signed-off-by: Hideki Saito <saito@fgrep.org>
This commit is contained in:
Hideki Saito
2026-06-30 08:45:30 +09:00
committed by GitHub
parent 674315f2da
commit 18f2f69c53
6 changed files with 105 additions and 9 deletions

View File

@@ -0,0 +1,22 @@
---
#
# Check: keysfile is symlink and follow=false
#
- name: Try to add key with keysfile as symlink
ansible.posix.authorized_key:
user: testuser
key: "{{ rsa_key_basic }}"
state: present
manage_dir: false
follow: false
- name: Assert target file ownership unchanged
ansible.builtin.stat:
path: /tmp/symlink_test_target/target_file
register: target_file_stat
- name: Verify target file is still owned by root
ansible.builtin.assert:
that:
- target_file_stat.stat.uid == 0
...