Skip to content

fix(sandbox): annotate the hidden-path Lstat for gosec G703 - #670

Merged
ion-alpha-dev merged 1 commit into
mainfrom
fix/readdeny-gosec-g703
Nov 4, 2026
Merged

ion-alpha-dev merged 1 commit into
mainfrom
fix/readdeny-gosec-g703

Conversation

@ion-alpha-dev

Copy link
Copy Markdown
Collaborator

What

Adds a //nolint:gosec with its reason to the os.Lstat in hidePath (sandbox/readdeny_linux.go).

Why

gosec reports G703 (path traversal via taint analysis) on that line, but only on some runs. Dependabot PR #668 failed Lint & format on it when the module cache failed to restore, then passed on a rerun of the same commit; main passed on the same base. A release build that starts from a cold cache would fail the same way.

The finding does not apply: p names a path the read-deny policy wants hidden, and hidePath only covers it with an empty tmpfs or /dev/null. A traversal in p can hide more, never let the command read more.

How to verify

CI Lint & format is green. No behaviour change, so no new test.

Notes for reviewers

nolintlint is not enabled, so the annotation does not fail lint on runs where gosec stays quiet.

gosec's taint analysis reports G703 (path traversal) on the os.Lstat in
hidePath, but only on some runs: dependabot PR #668 failed lint on it
when the module cache failed to restore, and passed on a rerun. A
release build that hits a cold cache would fail the same way.

The finding does not apply. p names a path the policy wants hidden, and
hidePath only covers it with an empty tmpfs or /dev/null, so a
traversal in p can hide more but never lets the command read more.

Signed-off-by: Ion Alpha <contact@ionalpha.io>
@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ion-alpha-dev
ion-alpha-dev merged commit 8f114a0 into main Nov 4, 2026
34 checks passed
@ion-alpha-dev
ion-alpha-dev deleted the fix/readdeny-gosec-g703 branch November 4, 2026 09:58
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant