Skip to content

Avoid CodeQL false positive in manifest path validation - #54097

Draft
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/uk-ai-resilience-fix-bad-redirect-check
Draft

Avoid CodeQL false positive in manifest path validation#54097
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/uk-ai-resilience-fix-bad-redirect-check

Conversation

Copilot AI commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

CodeQL flagged cleanManifestRelativePath for go/bad-redirect-check, despite the function only validating package-relative filesystem paths and never handling redirects.

  • Path validation: Replace generic strings.HasPrefix checks with equivalent leading-separator checks.
  • Regression coverage: Validate rejection of Unix, Windows backslash, and drive-letter absolute paths.
if len(slashed) > 0 && (slashed[0] == '/' || slashed[0] == '\\') ||
    filepath.IsAbs(p) || isWindowsDriveRelativePath(slashed) {
    return "", errors.New("absolute paths are not allowed")
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unreviewed CodeQL go/bad-redirect-check alert in add_package_manifest.go Avoid CodeQL false positive in manifest path validation Aug 20, 2026
Copilot AI requested a review from pelikhan August 20, 2026 00:35
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage

Category: chore | Risk: low | Priority: low (score 35/100)
Score breakdown: impact 10 + urgency 10 + quality 15
Recommended action: fast_track
Tiny (14-line) CodeQL false-positive fix in manifest path validation. Low risk — undraft and merge quickly to clear the CodeQL alert.

Generated by 🔧 PR Triage Agent · auto · 62.9 AIC · ⌖ 7.05 AIC · ⊞ 8.3K ·

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[uk-ai-resilience] UK AI Governance: unreviewed CodeQL go/bad-redirect-check alert in add_package_manifest.go (Tier B)

2 participants