Sighthound scan flagged 120 actionable findings outside test/testdata paths (34 Critical, 13 High, 73 Medium). Top 5 Critical findings selected below (each exec.Command call, CWE-78, High confidence — note exec.Command does not invoke a shell, so exploitability depends on whether the argument values are attacker-influenced; still worth validating/sanitizing inputs):
-
pkg/workflow/pip_validation.go:225 — Critical
exec.Command(uvPath, "pip", "show", pkgName, "--no-cache")
pkgName is passed as a discrete argv element (not shell-interpolated), but if derived from untrusted workflow frontmatter it should be validated against an allowlist pattern (e.g. valid PyPI package name regex) before use.
-
pkg/workflow/dependabot_manifests.go:263 — Critical
exec.Command(npmPath, "install", "--package-lock-only", "--ignore-scripts")
Verify npmPath resolution isn't influenced by untrusted PATH/config; pin to a resolved, validated executable path.
-
pkg/cli/grype.go:336 — Critical
exec.Command(dockerPath, dockerArgs...)
dockerArgs is built dynamically; confirm every element (image refs, volume mounts, tags) is validated/allowlisted before being passed, since a malicious image reference or mount path could escalate to host access.
-
pkg/cli/upgrade_command.go:507 — Critical
exec.Command(exe, newArgs...)
Ensure exe and newArgs originate only from trusted, validated sources (not directly from user-supplied CLI flags or remote data) before re-exec.
-
pkg/cli/git.go:705 — Critical
exec.Command("git", "-C", gitRoot, "log", upstream+"..HEAD", "--oneline", "--", relPath)
upstream/relPath are interpolated into a git revision range; validate upstream against expected ref syntax and ensure relPath is confined to the repo (no path traversal) before invocation.
Remediation guidance (general):
exec.Command already avoids shell metacharacter injection since args aren't shell-parsed, but validate/allowlist all externally-influenced argv values (paths, package/image names, refs) to prevent argument injection or unexpected binary/flag execution.
- Resolve executable paths (
uvPath, npmPath, dockerPath, exe) via trusted, fixed locations rather than dynamic lookup where possible.
- Add unit tests asserting rejection of malformed/malicious inputs (e.g.,
pkgName with ---prefixed flags, relPath with ../).
Full scan: 158 findings total, 120 actionable (excluding test/testdata). See summary.md for scan metadata.
Generated by 🛡️ Sighthound Security Scan · auto · 20.1 AIC · ⌖ 1.98 AIC · ⊞ 8.3K · ◷
Sighthound scan flagged 120 actionable findings outside test/testdata paths (34 Critical, 13 High, 73 Medium). Top 5 Critical findings selected below (each
exec.Commandcall, CWE-78, High confidence — noteexec.Commanddoes not invoke a shell, so exploitability depends on whether the argument values are attacker-influenced; still worth validating/sanitizing inputs):pkg/workflow/pip_validation.go:225— Criticalexec.Command(uvPath, "pip", "show", pkgName, "--no-cache")pkgNameis passed as a discrete argv element (not shell-interpolated), but if derived from untrusted workflow frontmatter it should be validated against an allowlist pattern (e.g. valid PyPI package name regex) before use.pkg/workflow/dependabot_manifests.go:263— Criticalexec.Command(npmPath, "install", "--package-lock-only", "--ignore-scripts")Verify
npmPathresolution isn't influenced by untrustedPATH/config; pin to a resolved, validated executable path.pkg/cli/grype.go:336— Criticalexec.Command(dockerPath, dockerArgs...)dockerArgsis built dynamically; confirm every element (image refs, volume mounts, tags) is validated/allowlisted before being passed, since a malicious image reference or mount path could escalate to host access.pkg/cli/upgrade_command.go:507— Criticalexec.Command(exe, newArgs...)Ensure
exeandnewArgsoriginate only from trusted, validated sources (not directly from user-supplied CLI flags or remote data) before re-exec.pkg/cli/git.go:705— Criticalexec.Command("git", "-C", gitRoot, "log", upstream+"..HEAD", "--oneline", "--", relPath)upstream/relPathare interpolated into a git revision range; validateupstreamagainst expected ref syntax and ensurerelPathis confined to the repo (no path traversal) before invocation.Remediation guidance (general):
exec.Commandalready avoids shell metacharacter injection since args aren't shell-parsed, but validate/allowlist all externally-influenced argv values (paths, package/image names, refs) to prevent argument injection or unexpected binary/flag execution.uvPath,npmPath,dockerPath,exe) via trusted, fixed locations rather than dynamic lookup where possible.pkgNamewith---prefixed flags,relPathwith../).Full scan: 158 findings total, 120 actionable (excluding test/testdata). See
summary.mdfor scan metadata.