T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/engine.py:352- Finding
Unrestricted Environment Variable Disclosure to Child Skills and External Tools
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
SkillPilot appears to be a real scheduler, but it gives invoked tools broad inherited environment access and stores user request history in plaintext.
Install only if you are comfortable letting this skill execute other local skills and CLIs. Run it in a restricted environment with minimal environment variables, avoid placing secrets under the skill directory before packaging, and treat its history and reports as sensitive local data because queries, URLs, errors, and context may be retained in plaintext.
scripts/engine.py:352Unrestricted Environment Variable Disclosure to Child Skills and External Tools
scripts/learning.py:37Plaintext Persistence of Sensitive Queries, URLs, Errors, and Execution Context
scripts/package_skill.py:65Skill Packaging Recursively Includes Potential Credentials and Runtime Telemetry
scripts/test.py:28Shell Command Injection Through an Unquoted Project Path in the Test Utility
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).
python3 run_search.py "今日热点" # ✅ 正常执行
python3 run_search.py "test; rm -rf /" # ❌ 拒绝执行 python3 run_search.py "test | cat /etc/passwd" # ❌ 拒绝执行 python3 run_search.py 'test $(whoami)' # ❌ 拒绝执行
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
3. 环境变量传递 (scripts/engine.py)
# 检查点:subprocess.run 的 env 参数
env = os.environ.copy() # 继承环境变量
result = subprocess.run(cmd, env=env, ...)
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).
# ❌ 漏洞代码
cmd = f'''bash "skills/multi-search-engine/scripts/search.sh" "{query}"'''
subprocess.run(cmd, shell=True, ...)
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
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).
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
风险: 用户输入的 query 直接嵌入 shell 命令,攻击者可注入恶意命令
# 攻击示例
query = "test; rm -rf /"
# 执行:bash "skills/.../search.sh" "test; rm -rf /"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 预期:拒绝执行,返回错误
# 3. 注入尝试 - 管道
python3 run_search.py "test | cat /etc/passwd"
# 预期:拒绝执行,返回错误
# 4. 注入尝试 - 命令替换
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 预期:拒绝执行,返回错误
# 3. 注入尝试 - 管道
python3 run_search.py "test | cat /etc/passwd"
# 预期:拒绝执行,返回错误
# 4. 注入尝试 - 命令替换
This finding includes an undeclared filesystem write location for reports under the workspace, which is a real capability expansion if not clearly surfaced in permissions or behavior docs. Hidden or insufficiently declared writes can overwrite user data, persist sensitive outputs, or create an unexpected foothold for later processing, especially in an orchestration skill that handles broad inputs.
This finding includes an undeclared filesystem write location for reports under the workspace, which is a real capability expansion if not clearly surfaced in permissions or behavior docs. Hidden or insufficiently declared writes can overwrite user data, persist sensitive outputs, or create an unexpected foothold for later processing, especially in an orchestration skill that handles broad inputs.
This finding includes an undeclared filesystem write location for reports under the workspace, which is a real capability expansion if not clearly surfaced in permissions or behavior docs. Hidden or insufficiently declared writes can overwrite user data, persist sensitive outputs, or create an unexpected foothold for later processing, especially in an orchestration skill that handles broad inputs.
This finding includes an undeclared filesystem write location for reports under the workspace, which is a real capability expansion if not clearly surfaced in permissions or behavior docs. Hidden or insufficiently declared writes can overwrite user data, persist sensitive outputs, or create an unexpected foothold for later processing, especially in an orchestration skill that handles broad inputs.
This finding includes an undeclared filesystem write location for reports under the workspace, which is a real capability expansion if not clearly surfaced in permissions or behavior docs. Hidden or insufficiently declared writes can overwrite user data, persist sensitive outputs, or create an unexpected foothold for later processing, especially in an orchestration skill that handles broad inputs.
This finding includes an undeclared filesystem write location for reports under the workspace, which is a real capability expansion if not clearly surfaced in permissions or behavior docs. Hidden or insufficiently declared writes can overwrite user data, persist sensitive outputs, or create an unexpected foothold for later processing, especially in an orchestration skill that handles broad inputs.