T09 · Insecure Skill Coding Practices
- Location
SKILL.md:6- Finding
Unvalidated Script Execution from a Dynamically Located Skills Root
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 6
Vulnerability Type: Execution of an unverified local script selected through an unspecified root-discovery process
Risk Level: HighVulnerable Code Snippet
markdown Read `references/provider-selection.md` before choosing a source. Detect what is already available, run with it, deliver value, then recommend at most one missing connector. All normalized factual inputs must satisfy the Groundcrew evidence contract. Locate the active skills root and run `<skills-root>/.groundcrew/groundcrew-doctor.py --evidence <record.json>` before using them in a conclusion. Output follows `references/reporting.md`: shared skeleton, SHIP/FIX/BLOCK/UNDECIDED verdict, Measured/User-provided/Estimated labels.Technical Analysis
The skill instructs the agent to dynamically locate an “active skills root” and execute
groundcrew-doctor.pyfrom that location. It does not define a trusted canonical path, verify file ownership or permissions, validate a cryptographic digest, or otherwise establish that the selected script belongs to a trusted installation.The audited package does not contain
.groundcrew/groundcrew-doctor.py, so the executable is outside the reviewed project boundary. Its behavior can therefore differ from the behavior implied by the reviewed skill files. If an attacker can influence skills-root discovery or write to the selected directory, the attacker can supply a malicious script at the expected path.This is an insecure coding and configuration practice rather than an embedded malicious payload: the vulnerable instruction creates a local code-execution trust boundary without specifying how that boundary must be authenticated.
Attack Path
- An attacker gains write access to a directory that can be selected as the active skills root, or influences the agent's root-discovery mechanism.
- The attacker creates the expected path:
.groundcrew/groundcrew-doctor.py. - T ...[truncated 1407 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace dynamic skills-root discovery with a canonical, administrator-configured absolute path.
- Require the script and all parent directories to be owned by a trusted account and reject paths writable by untrusted users or groups.
- Resolve symbolic links before execution and verify that the final path remains inside the approved installation directory.
- Pin and verify a cryptographic digest or signed manifest for
groundcrew-doctor.pybefore every execution. - Invoke the script with a fixed interpreter and argument array rather than constructing a shell command.
- Validate and canonicalize
record.json; ensure it is a regular file in an approved directory and cannot inject command-line options. - Run the validator in a sandbox with minimal filesystem, environment, and network access.
- Fail closed when the trusted validator is absent or verification fails. Do not search alternate writable roots.
- Include the reviewed validator in the skill package, or declare it as a version-pinned and integrity-verified dependency so that the executable code is within the audit boundary.
