T03 · Remote Payload Retrieval and Execution
- Location
scripts/bootstrap-host.sh:336- Finding
Unverified ACME Installer Is Piped Directly into a Root Shell
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is not clearly malicious, but it needs Review because it performs root-level VPS changes with under-guarded supply-chain, firewall, update, and credential-handling risks.
Install this only for a dedicated VPS where replacing firewall policy, Docker state, nginx configuration, and 3X-UI state is acceptable. Prefer SSH keys over --ssh-password, review or pin the Docker/acme/3X-UI sources before running, back up current UFW rules and /opt/3x-ui, and treat add-inbound-client.py --dry-run as contacting the panel unless fixed.
scripts/bootstrap-host.sh:336Unverified ACME Installer Is Piped Directly into a Root Shell
scripts/bootstrap-host.sh:289Unverified Docker Convenience Installer Executes as Root
scripts/bootstrap-host.sh:299Mutable Latest Container Image Runs with Host Networking and Automatic Restart
scripts/bootstrap-host.sh:442Unescaped Deployment Values Are Later Sourced by a Root Shell
scripts/add-inbound-client.py:203Add-Client Dry-Run Mode Transmits Credentials and Performs Panel Requests
scripts/bootstrap-host.sh:434Bootstrap and Update Operations Destructively Reset the Entire UFW Policy
The skill advertises a tightly scoped 3X-UI deployment workflow, but the available behavior includes generic SSH access with plaintext password support, which materially expands what can be done on remote systems. This mismatch is dangerous because operators or policy systems may trust the declared purpose while the implementation enables broader remote access and credential handling than expected.
Referenced artifact was not completely inspected
Use [`scripts/bootstrap-host.sh`](scripts/bootstrap-host.sh).
Referenced artifact was not completely inspected
Use [`scripts/bootstrap-host.sh`](scripts/bootstrap-host.sh).
Referenced artifact was not completely inspected
Use [`scripts/bootstrap-host.sh`](scripts/bootstrap-host.sh).
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
ssh <target> 'ss -ltnp | egrep ":2053 |:2096 |:1234 "'
curl -k -I https://<domain>/
Expected result:
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
sh /tmp/get-docker.sh
rm -f /tmp/get-docker.sh
fi
cat > "${WORKDIR}/docker-compose.yml" <<EOF
Piping a network-fetched script directly into sh as root executes unverified remote code with full system privileges. If the upstream source, transport path, DNS, or delivery endpoint is compromised, the VPS can be fully taken over; this is especially dangerous here because the script already targets remote root-managed hosts.
fi
if [[ ! -d "/root/.acme.sh" ]]; then
curl -fsSL https://get.acme.sh | sh -s email="${ACME_EMAIL:-}"
fi
if [[ -n "${ACME_EMAIL}" ]]; then
Resetting UFW with --force reset wipes the host's entire firewall policy, not just rules related to 3X-UI, and then applies a minimal replacement ruleset. On a multipurpose VPS this can unintentionally expose services or break access controls relied on by other applications, making it a real and potentially severe security issue.
Using ufw --force reset suppresses interactive safeguards and immediately destroys existing firewall configuration. The danger is amplified because this runs remotely on a root-managed VPS, where a mistaken reset can remove defense-in-depth controls or cause lockout/exposure before replacement rules are correctly applied.
docker restart 3x-ui >/dev/null
sleep 5
ufw --force reset >/dev/null
ufw default deny incoming >/dev/null
ufw default allow outgoing >/dev/null
ufw allow "${SSH_PORT}/tcp" >/dev/null
The remote script performs broad system modifications without confirmation, including apt upgrade, container redeployment, database changes, service restart, and a full ufw --force reset. In a root-managed VPS context, this can immediately disrupt connectivity, remove existing firewall policy, or break unrelated services, making the lack of explicit warning and confirmation a meaningful operational security risk.
ufw --force reset wipes all existing firewall rules and profiles before applying a narrow new policy set. On a multi-purpose VPS or a host with custom management ports, VPNs, monitoring, or service-specific rules, this can lock out administrators or unintentionally expose or disable services; because it runs as root on a remote host, the skill context makes this especially dangerous.
docker restart 3x-ui >/dev/null
if command -v ufw >/dev/null 2>&1; then
ufw --force reset >/dev/null
ufw default deny incoming >/dev/null
ufw default allow outgoing >/dev/null
ufw allow "${SSH_PORT}/tcp" >/dev/null
The skill explicitly instructs operators to run shell commands and make network connections to remote VPS hosts, but it declares no tool scope or permission boundaries. In a skill that can mutate remote infrastructure, missing explicit permission metadata increases the chance of over-broad execution, accidental misuse, or the agent invoking capabilities beyond what reviewers expect.
The script performs extensive remote root actions including package installation/removal, nginx activation, certificate issuance, Docker installation, database mutation, container restart, and firewall reconfiguration without an explicit destructive-operation warning or confirmation step. Even when the functionality is expected, the lack of clear user-facing guardrails materially increases the chance of accidental harmful execution against the wrong host or on a host with other services.
The script removes existing container-related packages and installs Docker via a remote bootstrap script, which changes core host software outside the narrow scope of configuring 3X-UI. In a root-managed VPS context this may be intended, but it is still dangerous because it can disrupt unrelated workloads and replaces system components without interactive confirmation or compatibility checks.
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.
write_http_only_nginx_site
nginx -t
systemctl enable --now nginx
systemctl reload nginx
DOMAIN_A_RECORDS="$(dig +short A "${DOMAIN}" | awk 'NF')"
The script explicitly supports passing an SSH password on the command line and then exports it into the environment for use by an askpass helper. Plain-text credentials supplied this way may be exposed via shell history, process listings, logs, or inherited environments, which is especially risky in a root/VPS administration skill where highly privileged credentials are likely involved.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
printf '%s\n' "${SSH_PASSWORD?}"
EOF
chmod 700 "${ASKPASS_SCRIPT}"
export SSH_PASSWORD
export SSH_ASKPASS="${ASKPASS_SCRIPT}"
The script forces password-based authentication by disabling public-key authentication and preferring password/keyboard-interactive methods. While not an exploit on its own, this is an unsafe default because it nudges users away from stronger SSH key-based auth and increases the chance that privileged credentials are transmitted, reused, or brute-forced in operational workflows.
export DISPLAY="${DISPLAY:-codex-askpass}"
ssh \
-o PubkeyAuthentication=no \
-o PreferredAuthentications=password,keyboard-interactive,password \
"$@"
The script explicitly accepts an SSH password via a command-line parameter and forwards it to another helper script. Command-line secrets are commonly exposed through shell history, process listings, CI logs, and audit tooling, so this creates a real credential-handling weakness even if the overall administrative intent is legitimate.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
set -euo pipefail
if [[ "${EUID}" -ne 0 ]]; then
echo "Run as root on the remote host." >&2
exit 1
fi
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
set -euo pipefail
if [[ "${EUID}" -ne 0 ]]; then
echo "Run as root on the remote host." >&2
exit 1
fi
No suspicious patterns detected.