Skip to content

Add regression coverage for pip argv validation before exec - #54282

Merged
pelikhan merged 4 commits into
mainfrom
copilot/sighthound-fix-security-findings
Aug 20, 2026
Merged

Add regression coverage for pip argv validation before exec#54282
pelikhan merged 4 commits into
mainfrom
copilot/sighthound-fix-security-findings

Conversation

Copilot AI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Sighthound flagged low-confidence command-injection findings around exec.Command(..., args...) in workflow/package validation paths. This change narrows triage risk by adding explicit regression coverage for the pip validation exec boundary: invalid option-like package input must be rejected pre-exec, while valid packages must preserve expected argv shape.

  • Validation boundary coverage (pip path)

    • Added a test that passes --index-url as a package and asserts no pip process invocation occurs.
    • This guards the exact concern in validatePythonPackagesWithPip where package names are transformed into CLI args.
  • Expected argv contract for valid input

    • Added a test that passes requests and asserts the forwarded argv is exactly:
      • index
      • versions
      • requests
      • --pre
    • This makes argument construction behavior explicit and reviewable for future changes.
  • Scope

    • Test-only update in pkg/workflow/argument_injection_test.go; no production logic change.
compiler.validatePythonPackagesWithPip([]string{"--index-url"}, "pip", fakePip)
// assert args file does not exist (invalid package rejected before exec)

compiler.validatePythonPackagesWithPip([]string{"requests"}, "pip", fakePip)
// assert argv == []string{"index", "versions", "requests", "--pre"}

Copilot AI and others added 2 commits August 20, 2026 16:05
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Review security findings in github/gh-aw Add regression coverage for pip argv validation before exec Aug 20, 2026
Copilot AI requested a review from pelikhan August 20, 2026 16:13
@pelikhan
pelikhan marked this pull request as ready for review August 20, 2026 16:41
Copilot AI balanced review requested due to automatic review settings August 20, 2026 16:41
@pelikhan
pelikhan merged commit d3dd958 into main Aug 20, 2026
@pelikhan
pelikhan deleted the copilot/sighthound-fix-security-findings branch August 20, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds regression tests for pip argument validation at the process-execution boundary.

Changes:

  • Verifies invalid option-like package names never reach pip.
  • Verifies valid packages preserve the expected pip argv.
Show a summary per file
File Description
pkg/workflow/argument_injection_test.go Adds fake-pip execution boundary tests.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sighthound] Security findings in github/gh-aw

3 participants