T03 · Remote Payload Retrieval and Execution
- Location
scripts/run_script_tests.py:91- Finding
LLM-Generated Shell Commands Are Automatically Executed
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real regression-testing skill, but it can automatically run shell commands from tested skills or LLM-generated cases and can leave an OpenClaw cron probe behind.
Install or use this only if you are comfortable running it in a disposable sandbox or only against skills you already trust. Before running regression on third-party skills, inspect TEST.md and generated cases, avoid executing generated script_cmd values, force --backend api if you do not want OpenClaw cron jobs, and do not set SR_REPORT_UPLOAD_HOOK unless the hook script is trusted.
scripts/run_script_tests.py:91LLM-Generated Shell Commands Are Automatically Executed
scripts/run_script_tests.py:71Untrusted TEST.md Files Can Execute Arbitrary Shell Commands
scripts/run_agent_tests.py:66OpenClaw Backend Creates a Persistent Mutable Cron Probe Without Cleanup
README.md:118Unpinned Dependency Installation Bypasses System Package Protections
This mismatch is more security-relevant because the documentation emphasizes testing/reporting but understates filesystem mutation in the target skill directory. Users may grant trust assuming read-mostly analysis, while the skill can rename or create files, which can alter repositories or test artifacts unexpectedly.
This mismatch is more security-relevant because the documentation emphasizes testing/reporting but understates filesystem mutation in the target skill directory. Users may grant trust assuming read-mostly analysis, while the skill can rename or create files, which can alter repositories or test artifacts unexpectedly.
This mismatch is more security-relevant because the documentation emphasizes testing/reporting but understates filesystem mutation in the target skill directory. Users may grant trust assuming read-mostly analysis, while the skill can rename or create files, which can alter repositories or test artifacts unexpectedly.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env python3
"""
_lib_config.py — Shared config loader with .env support + onboarding.
Resolution priority (high -> low):
1. CLI args
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GLOBAL_CONFIG_DIR = Path.home() / ".config" / "skill-regression"
GLOBAL_ENV_FILE = GLOBAL_CONFIG_DIR / ".env"
# Required keys per backend
REQUIRED_KEYS = {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GLOBAL_CONFIG_DIR = Path.home() / ".config" / "skill-regression"
GLOBAL_ENV_FILE = GLOBAL_CONFIG_DIR / ".env"
# Required keys per backend
REQUIRED_KEYS = {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GLOBAL_CONFIG_DIR = Path.home() / ".config" / "skill-regression"
GLOBAL_ENV_FILE = GLOBAL_CONFIG_DIR / ".env"
# Required keys per backend
REQUIRED_KEYS = {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GLOBAL_CONFIG_DIR = Path.home() / ".config" / "skill-regression"
GLOBAL_ENV_FILE = GLOBAL_CONFIG_DIR / ".env"
# Required keys per backend
REQUIRED_KEYS = {
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GLOBAL_CONFIG_DIR = Path.home() / ".config" / "skill-regression"
GLOBAL_ENV_FILE = GLOBAL_CONFIG_DIR / ".env"
# Required keys per backend
REQUIRED_KEYS = {
The upload hook's stdout is treated as a printed URL and surfaced to downstream consumers, while the hook itself is fully attacker-controlled via environment variable. This combination enables both arbitrary code execution and potentially misleading or malicious output injection into logs or automation that trusts REPORT_URL, increasing the chance of phishing, poisoned links, or unsafe follow-on actions.
if upload_hook:
print(f" → Running upload hook: {upload_hook}")
try:
proc = subprocess.run(
[upload_hook, args.output, skill_name, now_date],
capture_output=True, text=True, timeout=120,
)
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).
print(cfg.get('SR_BACKEND', 'api'))
" > /tmp/.sr_backend.$$ 2>&1; then
cat /tmp/.sr_backend.$$ >&2
rm -f /tmp/.sr_backend.$$
exit 2
fi
DETECTED_BACKEND=$(tail -1 /tmp/.sr_backend.$$)
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).
print(cfg.get('SR_BACKEND', 'api'))
" > /tmp/.sr_backend.$$ 2>&1; then
cat /tmp/.sr_backend.$$ >&2
rm -f /tmp/.sr_backend.$$
exit 2
fi
DETECTED_BACKEND=$(tail -1 /tmp/.sr_backend.$$)
Using shell=True with attacker-influenced input enables shell metacharacter injection and full tool-parameter abuse, allowing chaining of arbitrary commands beyond the intended test action. Because this framework may be used in CI or on developer workstations with API keys and source access, exploitation could lead to credential theft, source tampering, or broader host compromise.
# meaning any command in TEST.md will execute. Only trust TEST.md from trusted sources.
# ⚠️ Output merging: actual_output = stdout + stderr,
# which is risky for exact-mode assertions (stderr warnings break match). Prefer contains/regex.
proc = subprocess.run(
script_cmd,
shell=True,
cwd=skill_dir,