T09 · Insecure Skill Coding Practices
- Location
lib/checks.sh:327- Finding
Arbitrary Local Command Execution Through eval
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real GPU-cluster checker, but it includes unsafe switch and container checks that deserve manual review before installation.
Review this skill before installing on production or privileged cluster nodes. Avoid using SWITCH_CLI_CMD unless the environment is fully trusted, prefer pinned and approved container images, require normal SSH host-key verification for switches, set MOUNT_POINT deliberately, and run the checks with the least privilege that still permits the diagnostics you need.
lib/checks.sh:327Arbitrary Local Command Execution Through eval
lib/checks.sh:123Mutable Remote Container Images Are Automatically Retrieved and Executed
lib/checks.sh:327SSH Host Identity Verification Is Disabled for Switch Connections
lib/checks.sh:11Unvalidated Peer Values Can Be Interpreted as SSH Options
Potential security issue detected. Manual review is recommended.
if [ "$vendor" = nvidia ]; then
docker run --rm --gpus all nvidia/cuda:12.4.0-base-ubuntu22.04 nvidia-smi --query-gpu=gpu_name --format=csv,noheader
elif [ "$vendor" = amd ]; then
docker run --rm --device /dev/kfd --device /dev/dri rocm/rocm-terminal rocm-smi --showproductname
else
echo "No GPU vendor detected" >&2
return 1
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).
done
fi
[ -z "$mp" ] && mp=/tmp
df -h "$mp" && touch "$mp/.clusterready_test" && rm -f "$mp/.clusterready_test" && echo "read/write OK on $mp"
}
# 1.11 GPUDirect Kernel Module
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
done
fi
[ -z "$mp" ] && mp=/tmp
df -h "$mp" && touch "$mp/.clusterready_test" && rm -f "$mp/.clusterready_test" && echo "read/write OK on $mp"
}
# 1.11 GPUDirect Kernel Module
The switch validation function executes the contents of SWITCH_CLI_CMD via 'eval', which allows arbitrary shell command execution if that environment variable is attacker-controlled or accidentally mis-set. Because this skill is intended for infrastructure pre-flight checks and may run with elevated privileges on cluster nodes, exploitation could lead to full local command execution on sensitive systems.
The skill documentation states that check 1.10 validates a shared mount with read/write access, but it does not clearly warn users that running the check may modify the target filesystem. On infrastructure skills, undocumented write behavior can cause unintended changes to production or shared storage, especially if operators assume the tool is read-only health validation.
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
The AMD container check uses 'rocm/rocm-terminal' without an explicit tag or digest, so each run may pull a different image over time. In a pre-flight check that may be executed on privileged cluster nodes, this creates avoidable supply-chain risk because behavior and contents of the image are not fixed.
The function can execute shell commands sourced from an environment variable, but there is no explicit warning, confirmation, or disclosure to the operator that arbitrary local commands may run. In practice this increases the chance of unsafe use, especially in automation pipelines where environment variables may come from CI, orchestration, or inherited shell state.
The SSH-based switch check disables host key verification with 'StrictHostKeyChecking=no', making the connection vulnerable to man-in-the-middle attacks or silent connection to an impostor host. In a cluster/network administration context, that is more dangerous because the command may query or trust data from infrastructure devices on privileged networks.
No suspicious patterns detected.