T08 · Insecure Dependencies
- Location
scripts/loop.py:15- Finding
Unverified Execution of Scripts from Predictable Sibling Skill Paths
- Content
View full analysis
Vulnerability Details
File Location:
scripts/loop.py:15-40(execution sites at lines 58-59, 88-89, and 110-111)
Vulnerability Type: Untrusted local dependency execution
Risk Level: HighVulnerable Code
python SKILLS_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) SELF_DIR = os.path.dirname(__file__) # Capability to script-path mapping CAP_SCRIPTS = { "long-horizon-planner": os.path.join(SKILLS_DIR, "long-horizon-planner", "scripts", "planner.py"), "reason-verify": os.path.join(SKILLS_DIR, "reason-verify", "scripts", "verify.py"), "rag": os.path.join(SKILLS_DIR, "rag", "scripts", "rag_query.py"), } def _run(py, args, timeout=60): try: r = subprocess.run([sys.executable, py] + args, capture_output=True, text=True, timeout=timeout) return r.returncode == 0, r.stdout + r.stderr except Exception as e: return False, str(e)The mapped files are executed at the following call sites:
python ok, out = _run(planner, ["init", "--goal", goal, "--horizon", "60", "--out", road])python ok, out = _run(rag, ["--index", idx, "--question", goal, "--topk", "1", "--out", tmp])python ok, out = _run(rv, ["reason", "--question", goal, "--answer", plan_text, "--out", outp])Technical Analysis
The Skill derives dependency locations from a shared parent directory and treats the existence of a Python file at the expected path as sufficient authorization to execute it. It does not verify the dependency's package identity, version, cryptographic hash, file ownership, permissions, trusted installation root, or provenance.
Although the subprocess command uses an argument list rather than a shell and is therefore not directly vulnerable to shell command injection, the Python script itself is an executable dependency. Any actor who can create or r ...[truncated 1687 chars]
- Remediation
View remediation
Remediation Suggestions
- Install external Skills through an authenticated package-management process and pin exact versions.
- Maintain an allowlist containing an expected cryptographic hash or signed manifest for every executable dependency.
- Verify each dependency immediately before execution, including its resolved path, package identity, hash, ownership, and permissions.
- Reject symlinks and ensure the canonical dependency path remains inside an explicitly trusted, non-user-writable installation directory.
- Do not infer trust solely from a file's presence at a conventional path.
- Require explicit user approval before first use of an external Skill or when its identity or hash changes.
- Run dependencies in a sandbox with a minimal environment, restricted filesystem access, disabled network access unless required, resource limits, and reduced operating-system privileges.
- Prefer a narrow, validated data interface over executing arbitrary Python files. Validate all returned JSON against a strict schema.
- Record the verified dependency identity and version in the generated report to support auditing and incident response.
