T08 · Insecure Dependencies
- Location
scripts/guarded_flow.py:90- Finding
Installation and update operations execute untrusted package code before security approval
- Content
View full analysis
int: policy = load_policy(args.policy) roots = default_scan_roots(policy) before = snapshot_roots(roots) command = [args.npx_bin, "skills", "add", args.package] if args.global_install: command.append("-g") if args.yes: command.append("-y") if args.extra_args: command.extend(args.extra_args) exit_code = run_command(command, WORKSPACE) if exit_code != 0: return exit_code after = snapshot_roots(roots) changed = detect_changed_dirs(before, after) for skill_dir in changed: ensure_safe(skill_dir, policy, "install") return 0 def command_npx_update(args: argparse.Namespace) -> int: policy = load_policy(args.policy) roots = default_scan_roots(policy) before = snapshot_roots(roots) command = [args.npx_bin, "skills", "update"] if args.extra_args: command.extend(args.extra_args) exit_code = run_command(command, WORKSPACE) if exit_code != 0: return exit_code after = snapshot_roots(roots) changed = detect_changed_dirs(before, after) if not changed: changed = [path for root in roots for path in root.iterdir() if path.is_dir()] for skill_dir in changed: ensure_safe(skill_dir, policy, "update") return 0 ``` ### Technical Analysis Both guarded package workflows invoke the real package manager before calling `ensure_safe()`. Consequently, the scan is a post-installation or post-update check rather than a security gate. Package managers and their wrappers can execute lifecycle hooks, installer scripts, or other package-controlled behavior during installation and update. Such code may run before the package files appear in the monitored skill directorie ...[truncated 1776 chars]- Remediation
View remediation
