T09 · Insecure Skill Coding Practices
Error
- Location
- references/fact-producers.md:158
- Finding
- Static audit workflow executes untrusted target-repository code without isolation## Vulnerability Details **File Location**: `references/fact-producers.md:158-165` **Additional Locations**: `references/change-audit.md:120-126`, `references/verification-gates.md:249-268`, `SKILL.md:189-197` **Vulnerability Type**: Execution of untrusted repository code in the auditor's environment **Risk Level**: High ### Vulnerable Instructions `references/fact-producers.md:158-165` instructs the agent to execute tests from the repository under audit: ```powershell uv run --with coverage python -m coverage run ` --include="*/src/<package>/<file>.py" ` -m pytest <test-file> -o addopts="" -p no:randomly uv run --with coverage python -m coverage json -o <output-path>.json ``` `SKILL.md:189-197` additionally instructs the agent to verify reproduction commands from the audit report: ```powershell node <euthyna repository>/bin/euthyna.js gate <report-file> # Re-run each reproduction command for verification: node <euthyna repository>/bin/euthyna.js gate <report-file> --verify --cwd <audited-repository> ``` `references/verification-gates.md:249-268` requires executable proof-of-concept validation and real execution output when feasible. ### Technical Analysis A repository submitted for security review is an untrusted input. Its author can control test modules, imported packages, module initialization code, pytest configuration, local pytest plugins, test fixtures, and proof-of-concept scripts. Running `pytest` is not a passive inspection operation. Python code can execute during test collection, plugin loading, module import, fixture initialization, and test execution. Similarly, re-running a reproduction command such as `node tools/poc.js` executes repository-controlled code. Restricting command invocation to an argument array or an allowed executable does not make the referenced script trustworthy. The documented workflow does not require an ephemer ...[truncated 2159 chars]
- Remediation
- ## Remediation Suggestions 1. Keep static auditing non-executing by default. Treat test execution and proof-of-concept execution as separate dynamic-analysis operations. 2. Require explicit user approval before running any code supplied by the repository under audit. 3. Execute target-controlled code only in an ephemeral sandbox, container, or virtual machine configured with: - An unprivileged identity. - No inherited environment secrets or host credentials. - A read-only mount of the target repository. - A separate, disposable writable output directory. - Disabled networking by default, with narrowly allowlisted access when necessary. - CPU, memory, process, and execution-time limits. - No host socket, device, home-directory, SSH-agent, or package-manager credential mounts. 4. Review every reproduction command and referenced script before execution. Do not assume that an executable allowlist makes script arguments safe. 5. Make `gate --verify` refuse to run unless an explicit sandbox configuration and opt-in confirmation are present. 6. Prefer parsing coverage artifacts already supplied by a trusted CI environment. If no trustworthy coverage artifact exists, record the criterion as not evaluated rather than executing untrusted tests on the host. 7. Document the execution trust boundary prominently in `SKILL.md` and the verification guides.
