T05 · Unauthorized Access and Privilege Escalation
- Location
roles/common/tasks/main.yml:48- Finding
Deployment User Receives Unrestricted Passwordless Root Access
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is coherent Ansible automation, but its defaults can make broad privileged changes to live servers without enough guardrails.
Review and edit the inventory before use, run only against explicit test hosts with --limit plus --check/--diff first, keep out-of-band server access before SSH/firewall changes, disable or narrow passwordless sudo, pin reviewed OpenClaw and package versions, verify repository keys, avoid passing passwords on command lines, and move logs/fact caches out of shared /tmp paths.
roles/common/tasks/main.yml:48Deployment User Receives Unrestricted Passwordless Root Access
roles/openclaw/tasks/main.yml:4Unpinned OpenClaw Package Is Installed Globally with Elevated Privileges
roles/nodejs/tasks/main.yml:11NodeSource Repository Trust Key Is Accepted Without Fingerprint Verification
SKILL.md:434SSH Password Is Passed Through Process Command-Line Arguments
ansible.cfg:12Ansible Logs and Fact Cache Use Predictable Shared Temporary Paths
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
**"Host key verification failed"**
- Add to ansible.cfg: `host_key_checking = False`
- Or add host key: `ssh-keyscan -H host >> ~/.ssh/known_hosts`
**"Module not found"**
- Use FQCN: `ansible.builtin.apt` instead of `apt`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
plane:
ansible_host: 217.13.104.99
ansible_user: asdbot
ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
# Example: Vault VPS (already configured)
vault:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
plane:
ansible_host: 217.13.104.99
ansible_user: asdbot
ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
# Example: Vault VPS (already configured)
vault:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
plane:
ansible_host: 217.13.104.99
ansible_user: asdbot
ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
# Example: Vault VPS (already configured)
vault:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
plane:
ansible_host: 217.13.104.99
ansible_user: asdbot
ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
# Example: Vault VPS (already configured)
vault:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
plane:
ansible_host: 217.13.104.99
ansible_user: asdbot
ansible_ssh_private_key_file: ~/.ssh/id_ed25519_plane
# Example: Vault VPS (already configured)
vault:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Pipe and redirects
- ansible.builtin.shell: cat /etc/passwd | grep deploy > /tmp/user.txt
# With environment
- ansible.builtin.shell: echo $MY_VAR
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Pipe and redirects
- ansible.builtin.shell: cat /etc/passwd | grep deploy > /tmp/user.txt
# With environment
- ansible.builtin.shell: echo $MY_VAR
Using ssh-keyscan to append directly to known_hosts can trust a host key without independent verification, which is unsafe on untrusted networks. An attacker performing man-in-the-middle interference at the time of collection could cause the client to pin a malicious host key and bypass later SSH warnings.
# Option 1: Add host key manually
ssh-keyscan -H hostname >> ~/.ssh/known_hosts
# Option 2: Disable host key checking (less secure)
# In ansible.cfg:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
---
# Node.js role - Install via NodeSource
- name: Ensure keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
---
# Node.js role - Install via NodeSource
- name: Ensure keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
---
# Node.js role - Install via NodeSource
- name: Ensure keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
---
# Node.js role - Install via NodeSource
- name: Ensure keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
---
# Node.js role - Install via NodeSource
- name: Ensure keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
---
# Node.js role - Install via NodeSource
- name: Ensure keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
---
# Node.js role - Install via NodeSource
- name: Ensure keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
This task uses a shell pipeline to fetch a remote GPG key with curl and immediately trust it for package installation, without an out-of-band fingerprint verification step. If the HTTPS source, DNS, or upstream distribution path were compromised, a malicious signing key could be installed and then used to trust attacker-controlled packages.
- name: Install NodeSource GPG key
ansible.builtin.shell: |
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
args:
creates: /etc/apt/keyrings/nodesource.gpg
tags: [nodejs]
The documentation provides playbooks for provisioning and hardening remote systems but does not explicitly warn that these actions will modify live infrastructure, restart services, alter firewall rules, and potentially lock out operators. In an agent skill context, examples that look copy-paste ready can cause unintended changes on production hosts if run without review.
These examples execute playbooks and ad-hoc commands against remote hosts, including shell and service operations, without a clear warning that they affect live systems. In a skill intended for agent use, this increases the chance of accidental execution on production infrastructure.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
# Create encrypted vars file
ansible-vault create inventory/group_vars/all/vault.yml
# Edit encrypted file
The troubleshooting guidance recommends disabling SSH host key checking without warning about man-in-the-middle risk. Turning off host verification removes a key trust control and can allow connections to spoofed hosts, which is especially dangerous for automation that may send credentials or execute privileged tasks.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
[privilege_escalation]
become = True
become_method = sudo
become_ask_pass = False
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
[privilege_escalation]
become = True
become_method = sudo
become_ask_pass = False
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
[privilege_escalation]
become = True
become_method = sudo
become_ask_pass = False
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
[privilege_escalation]
become = True
become_method = sudo
become_ask_pass = False
No suspicious patterns detected.