T09 · Insecure Skill Coding Practices
- Location
scripts/upload_media_remote.sh:24- Finding
SSH Host Authenticity Verification Is Disabled
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill's WordPress publishing purpose is clear, but its SSH automation can modify a live site and has concrete implementation risks that should be reviewed before install.
Treat this as a Review install. Use it only with a dedicated non-root SSH user and key, enable SSH host key verification, remove the --allow-root example, replace fixed /tmp state with private per-run files, validate numeric IDs, and fix remote command argument handling before enabling cron-based publishing.
scripts/upload_media_remote.sh:24SSH Host Authenticity Verification Is Disabled
scripts/publish_wp_remote.sh:100Untrusted Values Are Interpolated into Remote Shell Commands
scripts/publish_wp_remote.sh:33Predictable Shared Temporary Files Permit Local Tampering and Symlink Attacks
SKILL.md:277Dependency Installation Guidance Is Unpinned and Non-Reproducible
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
try:
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
data = response.json()
except requests.exceptions.RequestException as e:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
|----------|-------------|----------|---------|
| `WP_SSH_HOST` | Remote server hostname or IP | Yes | `203.0.113.10` or `example.com` |
| `WP_SSH_USER` | SSH username on remote server | Yes | `deploy`, `www-data`, `wpcli` |
| `WP_SSH_KEY` | Absolute path to SSH private key | Yes | `/home/user/.ssh/id_ed25519_wp` |
| `WP_SSH_PORT` | SSH port (default: 22) | No | `22` |
| `WP_REMOTE_PATH` | Absolute path to WordPress installation | Yes | `/var/www/html/wordpress` |
| `WP_REMOTE_TMP` | Writable temp directory on remote | No | `/tmp` |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
|----------|-------------|----------|---------|
| `WP_SSH_HOST` | Remote server hostname or IP | Yes | `203.0.113.10` or `example.com` |
| `WP_SSH_USER` | SSH username on remote server | Yes | `deploy`, `www-data`, `wpcli` |
| `WP_SSH_KEY` | Absolute path to SSH private key | Yes | `/home/user/.ssh/id_ed25519_wp` |
| `WP_SSH_PORT` | SSH port (default: 22) | No | `22` |
| `WP_REMOTE_PATH` | Absolute path to WordPress installation | Yes | `/var/www/html/wordpress` |
| `WP_REMOTE_TMP` | Writable temp directory on remote | No | `/tmp` |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
|----------|-------------|----------|---------|
| `WP_SSH_HOST` | Remote server hostname or IP | Yes | `203.0.113.10` or `example.com` |
| `WP_SSH_USER` | SSH username on remote server | Yes | `deploy`, `www-data`, `wpcli` |
| `WP_SSH_KEY` | Absolute path to SSH private key | Yes | `/home/user/.ssh/id_ed25519_wp` |
| `WP_SSH_PORT` | SSH port (default: 22) | No | `22` |
| `WP_REMOTE_PATH` | Absolute path to WordPress installation | Yes | `/var/www/html/wordpress` |
| `WP_REMOTE_TMP` | Writable temp directory on remote | No | `/tmp` |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
|----------|-------------|----------|---------|
| `WP_SSH_HOST` | Remote server hostname or IP | Yes | `203.0.113.10` or `example.com` |
| `WP_SSH_USER` | SSH username on remote server | Yes | `deploy`, `www-data`, `wpcli` |
| `WP_SSH_KEY` | Absolute path to SSH private key | Yes | `/home/user/.ssh/id_ed25519_wp` |
| `WP_SSH_PORT` | SSH port (default: 22) | No | `22` |
| `WP_REMOTE_PATH` | Absolute path to WordPress installation | Yes | `/var/www/html/wordpress` |
| `WP_REMOTE_TMP` | Writable temp directory on remote | No | `/tmp` |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 1. Generate a dedicated key pair (ed25519 recommended)
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_wp \
-C "openclaw-wp-publisher" -N ""
# 2. Copy public key to remote server
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 1. Generate a dedicated key pair (ed25519 recommended)
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_wp \
-C "openclaw-wp-publisher" -N ""
# 2. Copy public key to remote server
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 1. Generate a dedicated key pair (ed25519 recommended)
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_wp \
-C "openclaw-wp-publisher" -N ""
# 2. Copy public key to remote server
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
ssh -i ~/.ssh/id_ed25519_wp -o BatchMode=yes
deploy@203.0.113.10 "wp --info"
command="wp --allow-root",no-port-forwarding,no-X11-forwarding
ssh-ed25519 AAAA... openclaw-wp-publisher
The authorized_keys restriction example uses command="wp --allow-root", which permits forced execution of WP-CLI with root privileges if the associated key is used. In the context of a skill that automates remote content publishing and file transfer, granting a key a root-capable command materially increases the blast radius of key compromise or misuse and can enable full site or server modification depending on WP-CLI capabilities.
deploy@203.0.113.10 "wp --info"
command="wp --allow-root",no-port-forwarding,no-X11-forwarding
ssh-ed25519 AAAA... openclaw-wp-publisher
The skill is user-invocable and scheduled to run automatically, and it performs state-changing actions on a remote WordPress instance, including draft creation and publication. Although the behavior is described later in the document, the top-level description does not provide a clear warning that running the skill will modify a remote site on a schedule, increasing the risk of accidental or uninformed execution.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
sys.exit(1)
# Request random photo from Unsplash
url = 'https://api.unsplash.com/photos/random'
params = {
'query': query,
'orientation': 'landscape',
The script performs a second network request to a URL taken directly from the first HTTP response without validating the hostname or scheme. If the upstream API response is malicious, compromised, or unexpectedly altered, this could turn into server-side request forgery behavior or allow downloads from unintended locations.
# Download the image
try:
image_url = data['urls']['regular']
img_response = requests.get(image_url, timeout=60)
img_response.raise_for_status()
with open(output_path, 'wb') as f:
The documentation says the script creates a draft WordPress post from article data, which implies the parsed title, content, and excerpt are used as post fields. However, at L77-L80 the WP-CLI command supplies literal "file:///tmp/..." strings to --post_title, --post_content, and --post_excerpt, so the created post content does not match the documented intent of publishing the article body from JSON.
The script disables SSH host key verification with StrictHostKeyChecking=no, which makes it vulnerable to man-in-the-middle attacks during both scp and ssh operations. Because the script transfers content and then executes remote WP-CLI commands, an attacker who can intercept or impersonate the SSH host could capture data, alter published content, or cause commands to run on an attacker-controlled server.
-o StrictHostKeyChecking=no \
-o BatchMode=yes \
-o ConnectTimeout=15 \
-o PasswordAuthentication=no"
# --- Input Validation ---
if [ -z "$SSH_HOST" ] || [ -z "$SSH_USER" ] || [ -z "$SSH_KEY" ]; then
The SSH options explicitly disable host key verification with StrictHostKeyChecking=no, making the SCP and SSH connections vulnerable to man-in-the-middle attacks. An attacker on the network could impersonate the remote host, receive the uploaded file, or influence the remote command execution context while the script trusts the connection automatically.
# -o StrictHostKeyChecking=no: don't prompt about host keys
# -o BatchMode=yes: fail if password required (force key auth)
# -o ConnectTimeout=15: timeout for connection
# -o PasswordAuthentication=no: explicitly disable password auth
SSH_OPTS="-i $SSH_KEY -p $SSH_PORT \
-o StrictHostKeyChecking=no \
-o BatchMode=yes \
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
-o StrictHostKeyChecking=no \
-o BatchMode=yes \
-o ConnectTimeout=15 \
-o PasswordAuthentication=no"
# --- Input Validation ---
IMAGE_PATH="${1:-}"
This code creates or overwrites /tmp/wp_post_id.txt, which is a file write affecting local system state. While the script logs success afterward, there is no earlier user-facing warning, prompt, or comment specifically disclosing that it will persist the created post ID to a temporary local file.
The script writes sensitive workflow state to a fixed, predictable path in /tmp, which is a world-accessible shared directory on many systems. This can expose the media ID to other local users, enable symlink or clobbering issues, and causes undocumented local filesystem side effects that may be abused in multi-user or automated environments.