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.pyscript is vulnerable to shell command injection in itsprefetchsubcommand. It constructs a shell command as a string, interpolating variables like the repository revision (tag name), and then executes this string vianix-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, thecmd_prefetchfunction definescmd = f"nix-prefetch-github {args.owner} {args.repo} --quiet --rev {args.rev} | jq -r '.hash'"and executes it usingrun(["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_tagfunction inscripts/packages.pyusesgh release viewandgh apito retrieve tag names from remote repositories.
Audit Metadata