T09 · Insecure Skill Coding Practices
- Location
scripts/log_collector.py:100- Finding
SSH Host Authentication Is Disabled During Log Collection
- Content
View full analysis
Vulnerability Details
File Location:
scripts/log_collector.py:100-104
Vulnerability Type: Improper SSH host verification
Risk Level: Highpython result = subprocess.run( ['ssh', '-o', 'ConnectTimeout=10', '-o', 'StrictHostKeyChecking=no', f'openclaw@{vpn_ip}', cmd], capture_output=True, text=True, timeout=30 )Technical Analysis
The collector explicitly invokes SSH with
StrictHostKeyChecking=no. This permits previously unknown SSH host keys to be accepted without confirmation, preventing the collector from reliably establishing that it has connected to the intended node.The connection is used to retrieve system journals, syslog data, and OpenClaw logs. Consequently, the integrity of all remotely collected records depends on unauthenticated network routing rather than a pinned SSH host identity. The VPN connectivity check performed before SSH does not authenticate the SSH server and therefore does not mitigate this issue.
Attack Path
- A configured node has no trusted, pinned entry in the collector account's
known_hostsfile. - An attacker obtains a network position that permits interception, routing manipulation, VPN-node impersonation, or control of the configured destination address.
- The attacker presents an arbitrary SSH host key.
- The collector accepts that key because
StrictHostKeyChecking=nois enabled. - The collector authenticates and submits its fixed log-collection commands to the impersonated server.
- The attacker returns fabricated command output.
- The collector stores that output in
logs.dbas if it came from the legitimate node.
Impact Assessment
An attacker capable of network or destination impersonation can compromise the authenticity and integrity of collected logs. Fabricated records could conceal incidents, create false alerts, or mislead later monitoring and forensic analysis.
The attacker can also observe the command ...[truncated 447 chars]
- A configured node has no trusted, pinned entry in the collector account's
- Remediation
View remediation
Remediation Suggestions
- Remove
StrictHostKeyChecking=no. - Use
StrictHostKeyChecking=yesfor unattended collection. - Provision and pin every node's SSH host key before enabling scheduled collection.
- Use a dedicated, protected known-hosts file, for example:
python [ 'ssh', '-o', 'ConnectTimeout=10', '-o', 'StrictHostKeyChecking=yes', '-o', 'UserKnownHostsFile=/home/openclaw/.ssh/log_collector_known_hosts', # Remaining arguments... ] - Populate the dedicated file through an authenticated administrative process rather than dynamically trusting keys returned over the same network being verified.
- Alert on host-key mismatches instead of automatically replacing or accepting keys.
- Restrict permissions on the known-hosts file and its parent directory so that the collector account is the only non-administrative account able to access them.
- Remove
