T09 · Insecure Skill Coding Practices
- Location
scripts/discriminator.py:86- Finding
Unsandboxed Execution of Target-Controlled Benchmark and Runtime Scripts
- Content
View full analysis
float: """Run skill's benchmark suite and return fitness score (0-1).""" benchmark_script = skill_path / "scripts" / "benchmark.py" if not benchmark_script.exists(): # No benchmark → use simple correctness check return self._simple_correctness_check(skill_path) try: # Run benchmark in skill's workspace context result = subprocess.run( ["python3", str(benchmark_script)], cwd=skill_path, capture_output=True, text=True, timeout=60 ) ``` Additional execution paths invoke a target-controlled `scripts/run.py`: ```python subprocess.run( ["python3", str(main_script), "--benchmark"], capture_output=True, timeout=30 ) ``` ```python process = subprocess.Popen( ["python3", str(main_script), "--benchmark"], stdout=subprocess.PIPE, stderr=subprocess.PIPE ) ``` ### Technical Analysis The discriminator treats `scripts/benchmark.py` and `scripts/run.py` from the selected skill as trusted Python programs. These programs run with the same operating-system identity, environment variables, filesystem access, and network access as the evolution engine. The configured timeouts only constrain execution duration. They do not prevent filesystem modification, credential access, network connections, child-process creation, or attacks against other local processes. No container, namespace, restricted user, syscall filter, read-only mount, network policy, or environment-variable filtering is applied. This also contradicts the safety claims in `SKILL.md:169-175`, which state that variants are sandboxed and have no networ ...[truncated 1202 chars]- Remediation
View remediation
