Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: workspace-relative read paths for view tool + awk in go-source-analysis #39958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
fix: workspace-relative read paths for view tool + awk in go-source-analysis #39958
Changes from all commits
31b704a20a7d13cb865270a18175File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/zoom-out] Every other bash entry in this file scopes its path —
cat pkg/**/*.go,wc -l pkg/**/*.go,grep -r "func " pkg .... The bareawkentry grants the command with no argument restriction, so an agent could invokeawk '{print}' /etc/shadowand the shell permission would be approved (file-read permission is a separate gate, but defence-in-depth argues for scoping here too).💡 Suggestion: scope awk to pkg files
If the expected use is function-length counting across all Go files,
awk -F '' '{...}' pkg/**/*.gowould be more precise and consistent with the other entries.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awkbreaks the scoped-only convention of this shared component: every other tool listed here is path-restricted topkg/; bareawkis unrestricted and can read any sandbox-accessible file or invoke shell commands viasystem().💡 Analysis and suggestion
All prior entries in this shared workflow are scoped:
GNU
awkis fundamentally different — it can read arbitrary files (awk '{print}' /tmp/gh-aw/cache-memory/file) and execute shell commands (awk 'BEGIN{system("env")}' /dev/null). The compiled lock files happen to include unrestrictedshell(cat)from other shared components, so the practical containment boundary does not change. But this shared component silently widens its contract for all 4 importing workflows without documentation.Preferred alternative if
awkis only needed for Go source analysis:- awk pkg/**/*.goThat pattern is consistent with the rest of the list and is the form
extractReadablePathPatternsFromShellRulewould recognise as path-scoped (though that function currently only handlescat,xargs+cat, andlsprefixes, so an awk path restriction would not gate the SDKviewpermission handler either way).Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.