T09 · Insecure Skill Coding Practices
- Location
scripts/v2ray-proxy.sh:173- Finding
Shell Command Injection Through eval in the Command Wrapper
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real V2Ray proxy helper, but it uses an unsafe eval-based command wrapper and changes the user's shell profile without clear opt-in.
Review this before installing. It is purpose-aligned for managing a local V2Ray proxy, but the command wrapper should not be used with untrusted URLs, filenames, branch names, or user input, and the script may leave a persistent marker in ~/.bashrc. Prefer a version that removes eval, tracks its own V2Ray PID instead of using pkill -f, and makes any shell-profile changes explicit and reversible.
scripts/v2ray-proxy.sh:173Shell Command Injection Through eval in the Command Wrapper
scripts/v2ray-proxy.sh:83Implicit Persistent Modification of the User Shell Profile
scripts/v2ray-proxy.sh:53Broad Process Matching Can Terminate Unrelated Applications
The YARA hit is not evidence of malware by itself, but the matched behavior is real: the script appends to ~/.bashrc to create persistence. In this context it is concerning because the persistence is unnecessary for basic proxy toggling, not clearly disclosed, and can influence future shells and network behavior unexpectedly.
proxy="$PROXY_URL"
export HTTP_PROXY="$PROXY_URL"
export HTTPS_PROXY="$PROXY_URL"
# 设置no_proxy(跳过本地地址)
export no_proxy="localhost,127.0.0.1,::1,*.local"
export NO_PROXY="$no_proxy"
log_info "系统代理已开启: http_proxy=$PROXY_URL"
# 持久化到bashrc(可选)
if ! grep -q "V2RAY_PROXY" ~/.bashrc 2>/dev/null; then
echo "" >> ~/.bashrc
echo "# V2Ray Proxy (managed by OpenClaw)" >> ~/.bashrc
echo "export V2RAY_PROXY=1" >> ~/.bashrc
fi
}
# 清除系统代理
disable_system_proxy() {
log_info "清除系统代理..."
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
unset no_proxy NO_PROXY
log_info "系统代理已清除"
}
# 测试代理连接
test_proxy() {
log_info "测试代理连接..."
# 测试直连
local direct_result=$(curl -s --connect-timeout 5 -o /dev/null -w "%{http_code}" https://www.google.com 2>/dev/null || echo "000")
The wrap() function turns a proxy-management script into a generic command launcher by passing user-supplied input to eval. That greatly broadens the skill's capability beyond its stated purpose and creates command-injection risk if any caller passes untrusted or improperly quoted arguments, especially in an agent-driven environment where command strings may be constructed dynamically.
The README advertises automatic enabling/disabling of the system proxy, but does not clearly warn that this changes system-wide network behavior for other applications and may reroute or disrupt unrelated traffic. In a proxy-management skill, this omission is safety-relevant because users may invoke it expecting only local or per-command effects and unintentionally expose traffic to the configured proxy or break connectivity.
The skill advertises shell-based operations but does not declare any tool scope or permission boundaries. This weakens reviewability and least-privilege controls, making it easier for an agent or user to invoke system-modifying commands without an explicit trust signal about what tools and side effects are expected.
The skill describes automatic proxy management but does not clearly warn that it changes system-wide proxy settings. Users may trigger it expecting an isolated networking change, while the script can redirect traffic for other applications, affecting confidentiality, availability, and troubleshooting across the host.
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.
log_info "启动 V2Ray..."
cd "$V2RAY_DIR"
nohup ./v2rayN > /dev/null 2>&1 &
sleep 2
if is_running; then
The script persistently modifies ~/.bashrc even though the described skill behavior is temporary proxy management. Undisclosed shell startup modification creates unexpected persistence, can affect future sessions, and in an agent context is more dangerous because it changes user environment outside the immediate command scope.
Persistent modification of ~/.bashrc is performed without prominent user-facing disclosure, so users may not realize the script leaves lasting changes after use. In this skill context, hidden persistence is riskier because proxy configuration affects later shells and network behavior beyond the immediate task.
The script executes arbitrary shell text through eval in wrap() without any explicit warning or safety boundary. In practice, the danger is not merely missing warning text but that shell metacharacters, substitutions, and concatenated input can be interpreted, enabling unintended command execution if upstream input is attacker-controlled.
The README states that the skill automatically tests reachability to external sites such as github.com and google.com, but does not disclose that this creates outbound network requests that may reveal usage patterns, trigger monitoring, or violate restricted-network expectations. In this context the behavior is expected for connectivity detection, but the missing privacy/network notice still creates a real transparency and policy risk.
The natural-language content is entirely in Chinese and does not indicate that the user can choose another language or that the skill is intentionally restricted to a Chinese-speaking context. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.
No suspicious patterns detected.