packages-update

Warn

Audited by Gen Agent Trust Hub on Jun 17, 2026

Risk Level: MEDIUMCOMMAND_EXECUTIONEXTERNAL_DOWNLOADS
Full Analysis
  • [COMMAND_EXECUTION]: The scripts/packages.py script is vulnerable to shell command injection in its prefetch subcommand. It constructs a shell command as a string, interpolating variables like the repository revision (tag name), and then executes this string via nix-shell --run. Because the revision name is fetched directly from external GitHub repositories, a malicious actor could craft a tag name containing shell metacharacters (e.g., ;, &, |) to execute arbitrary commands.\n
  • Evidence: In scripts/packages.py, the cmd_prefetch function defines cmd = f"nix-prefetch-github {args.owner} {args.repo} --quiet --rev {args.rev} | jq -r '.hash'" and executes it using run(["nix-shell", "-p", "nix-prefetch-github", "jq", "--run", cmd])".\n- **[EXTERNAL_DOWNLOADS]:** Fetches package version metadata and release information from GitHub's official API using the GitHub CLI (gh`). While the source is a well-known service, the lack of sanitization on the retrieved data leads to the command injection vulnerability identified above.\n
  • Evidence: The latest_release_tag function in scripts/packages.py uses gh release view and gh api to retrieve tag names from remote repositories.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Jun 17, 2026, 08:49 AM
Security Audit — agent-trust-hub — packages-update