Skip to content

[sighthound] Security findings in github/gh-aw #53591

Description

@github-actions

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):

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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 ·

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions