T09 · Insecure Skill Coding Practices
- Location
scripts/critique_10khr_runner.py:402- Finding
Automated assessment executes untrusted Skill code
- Content
View full analysis
Vulnerability Details
File Location:
scripts/critique_10khr_runner.py:402-407, 586-592, 218-250; triggered bySKILL.md:132andscripts/10khr_cron_verify.py:149-152
Vulnerability Type: Execution of untrusted code during automated static assessment
Risk Level: HighTechnical Analysis
The Skill instructs autonomous workflows to run the verifier first:
markdown - [ ] Run `python3 scripts/10khr_cron_verify.py` FIRST in any autonomous pass — its output is authoritative for what to grindThe verifier imports the runner and assesses discovered Skills:
python runner = load_runner() state = runner.load_state() assessment = runner.run_full_assessment()During assessment, the runner executes each target Skill's unittest suite:
python tdir = os.path.join(skill_dir, "tests") if not (os.path.isdir(tdir) and glob.glob(os.path.join(tdir, "test_*.py"))): score -= 2; findings.append("no tests") else: rc, out = _run( [sys.executable, "-m", "unittest", "discover", "-s", "tests"], cwd=skill_dir ) if rc != 0: score -= 2 findings.append( "tests FAIL: " + (out.strip().splitlines() or ["?"])[-1][:60] )It also executes Python and shell scripts with
--helpbecause execution checks are enabled:python SCRIPT_TIMEOUT = 30 EXECUTE_CHECKS = Truepython if execute: cmd = ( ["bash", name, "--help"] if name.endswith(".sh") else [sys.executable, name, "--help"] ) rc, _ = _run(cmd, cwd=script_dir) ok.append(name) if rc == 0 else broken.append( "%s (rc=%d)" % (name, rc) )python script_dir = os.path.join(skill_dir, "scripts") _ok, broken_help, _n = check_scripts_help( script_dir, execute=EXECUTE_CHECKS )The assessment recursively discovers
ocas-*andutil-*Skills from profile directories. A Skill author controls itstests/test_*.py,scripts/*.py, andscripts/*.shfiles. Python mod ...[truncated 2029 chars]- Remediation
View remediation
Remediation Suggestions
- Make assessment static by default. Set
EXECUTE_CHECKS = Falseand remove direct unittest discovery from untrusted Skill assessment. - Do not use a textual outbound-operation blacklist as an authorization or execution boundary.
- Analyze scripts using source parsing and AST inspection without importing or executing target modules.
- If runtime validation is necessary, run it only in a disposable sandbox with:
- No inherited credentials or sensitive environment variables.
- No network access.
- A read-only copy of the target.
- No access to home directories or shared Skill/profile state.
- Strict CPU, memory, process, and time limits.
- A non-privileged, dedicated OS identity.
- Require explicit user approval that identifies the exact Skill and files before any runtime validation.
- Separate static assessment from opt-in dynamic testing, and clearly label dynamic testing as execution of untrusted code.
- Apply the same isolation requirements to test suites,
--helpchecks, import checks, and any PII gate scripts.
- Make assessment static by default. Set
