Skip to content

[uk-ai-resilience] [uk-ai-governance] Tier B: Sighthound CWE-78 (141 findings) — formal #nosec audit required in pkg/cli/ #48406

Description

@github-actions

Tier B — Open With Conditions

Source: UK AI Open Code Risk & Resilience Governance — 2026-07-27

Risk Scoring

Dimension Score (1–5) Notes
Exposure amplification 3 CLI commands invoked in agentic workflows; user-controlled args could reach exec.Command
Patchability 2 Code already has #nosec G204 with written justifications; formal review needed
Detectability 2 exec.Command without shell; exploitation requires controlled argument injection
Operational fragility 2 Low — existing mitigations limit exploit surface
Ownership confidence 5 @dsyme @eaftan @pelikhan @krzysztof-cieslak clearly own this area
Overall 2.8 Medium priority

Findings Summary

Sighthound #48298 flagged 141 CWE-78 command injection findings across pkg/cli/. The top 5 Critical are:

File Line Function Existing #nosec?
pkg/cli/runner_guard.go 94 runRunnerGuardOnDirectory ✅ Yes, with justification
pkg/cli/grant.go 156 grantRunOnImage ✅ Yes, with justification
pkg/cli/poutine.go 201 runPoutineOnFile Needs verification
pkg/cli/poutine.go 100 runPoutineOnDirectory Needs verification
pkg/cli/upgrade_command.go 496 relaunchWithSameArgs Needs verification

Code inspection confirms that runner_guard.go and grant.go have #nosec G204 with detailed inline justifications (path validation, exec.Command without shell). The remaining 139 findings need equivalent audit.

Remediation Action (SLA: Medium — 30 days)

  1. For each of the 141 Sighthound-flagged locations:
    • Verify exec.Command is called without a shell (no sh -c pattern)
    • Verify input validation exists (allowlists, filepath.Clean, path boundary checks)
    • Add // #nosec G204 -- <justification> if safe, or fix if not
  2. Dismiss the Sighthound issue [sighthound] Security findings in github/gh-aw #48298 once audit is complete with a comment linking to the ADR or code review
  3. Consider adding a Gosec/Semgrep test to CI that enforces #nosec annotations are accompanied by justification comments

Human Review Trigger

If any finding is found to lack input validation (no allowlist, no path sanitization), escalate to P1 fix before dismissal.

Related: #48298 | Governance discussion

Generated by UK AI Operational Resilience · sonnet46 · 83.5 AIC · ⌖ 7.39 AIC · ⊞ 5.3K ·

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions