T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/sentinal.py:332
- Finding
- Quarantine authorization and evidence requirements are not enforced## Vulnerability Details **File Location**: `scripts/sentinal.py:332-337` **Vulnerability Type**: Missing authorization and evidence gate for a destructive containment action **Risk Level**: Medium ### Vulnerable Code ```python def cmd_quarantine(args: argparse.Namespace) -> int: source = Path(args.path).expanduser().resolve() if not source.exists(): raise SystemExit(f"Path does not exist: {source}") destination = quarantine_skill(source, force=args.force) print(f"Quarantined: {destination}") return 0 ``` The resulting mutation occurs in `scripts/sentinal.py:206`: ```python shutil.move(str(source), str(destination)) ``` ### Technical Analysis The documented workflow requires explicit operator authorization and verified High or Critical evidence before quarantine. This requirement appears in `SKILL.md:103-108` and `references/quarantine-policy.md:6-15`. The executable entry point does not enforce either condition. It accepts any existing path and immediately delegates to `quarantine_skill()`. That helper enforces containment within the active skills tree, but it does not require: - A confirmation or `--apply` parameter. - A trusted scan-report path. - A successfully parsed report. - A High or Critical finding. - Any machine-verifiable authorization token or interactive confirmation. Consequently, a direct invocation bypasses the documented evidence and authorization gates. This is a reachable implementation flaw rather than evidence of malicious intent. ### Attack Path 1. An untrusted skill, scan report, issue, webpage, or other content persuades an Agent to invoke the quarantine command with the path of a legitimate active skill. 2. The Agent runs: ```bash python3 scripts/sentinal.py quarantine /path/inside/managed/skills/legitimate-skill ``` 3. `cmd_quarantine()` checks only whether the path exists. 4. `quarantine_skill()` verifies that the resolved path is below the configured active-skills root. 5. No scan re ...[truncated 855 chars]
- Remediation
- ## Remediation Suggestions 1. Require an explicit mutation flag, such as `--apply`, before quarantine can proceed. Keep the default behavior read-only and print the proposed source and destination. 2. Require a scan-report argument and parse it using a fail-closed policy. 3. Verify that the report: - Is readable and structurally unambiguous. - Corresponds to the exact target skill. - Was produced successfully. - Contains at least one High or Critical finding. 4. Add an interactive confirmation showing the resolved source and destination when a human terminal is available. For noninteractive use, require a separate explicit authorization option. 5. Revalidate the target immediately before moving it to reduce time-of-check/time-of-use risk. 6. If an administrative override is operationally necessary, expose it as a clearly named, auditable option and never enable it by default. 7. Add tests proving that quarantine fails when authorization is absent, the report is missing or malformed, findings are below High severity, or the report describes a different target.
