Repository navigation
Conversation
Collaborator
Author
|
Fixed all four review findings in f2b7f93:
All plugin tests pass ( |
Collaborator
Author
|
Fixed P1 finding in router_unix.go: verifyPluginPathOwnership now rejects any group-writable path component regardless of GID, closing the macOS shared-group (e.g. staff) bypass. Added a same-GID 0775 regression case in TestVerifyPluginPathOwnershipRefusesUnsafe; full plugin module tests pass with -mod=vendor. Commit 5830906. |
…ec (D-1396) pluginBinDir now returns an error when HOME is unset instead of falling back to /tmp/.nself/plugins/bin, which any local user could populate with a malicious binary that cron or systemd would execute with the caller's secrets. ProxyBinaryAt additionally walks every component of the resolved plugin path up to the plugins root and verifies that each is owned by the current uid and has no group- or world-write bits set. All callers of pluginBinDir and PluginBinDir are updated for the new (string, error) signature. A regression test proves refusal without HOME.
…ng, allow private-group write - Move verifyPluginPathOwnership uid/stat logic into router_unix.go and router_windows.go with build tags so GOOS=windows builds succeed. - Restore the blank line before the install hint and the two-space indent plus double newline in the hint text to match origin/main. - Allow group-write when the directory's gid matches the user's primary group (umask 002 / user-private-group installs); refuse foreign-gid group-write with a message suggesting chmod g-w. - Add tests that refuse world-writable and foreign-gid group-writable path components and wire the check through ProxyBinaryAt.
…perm (D-1396) internal/plugin was 102 lines over its package-size ceiling. The path resolution and ownership check now live in pluginperm (no errs import, so the errs fan-in ceiling holds) and the nself-<slug> binary check reuses the pluginname slug grammar. No ceiling is raised.
Collaborator
Author
|
Rebased onto origin/main and fixed the red CI (acbee64). The review findings text was empty, so I worked from the failing checks.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
D-1396: plugin router /tmp fallback and missing ownership checks
What changed
pluginBinDir()now returns an error when HOME is unset instead of falling back to/tmp/.nself/plugins/bin, which any local user could populate with a malicious binary that cron or systemd would execute with the caller's secrets.ProxyBinaryAtwalks every component of the resolved plugin path up to the plugins root and verifies each is owned by the current uid and has no group- or world-write bits set before exec.pluginBinDirandPluginBinDirupdated for the new(string, error)signature.TestPluginBinDirRefusesWithoutHOMEproves refusal without HOME.Verification
go vet ./internal/plugin/...: passedgo build ./...: passedgo test ./internal/plugin/... -count=1: all passed including new regression testOther rows assessed
pnpm install --frozen-lockfilesucceeds on origin/main; lockfile contains matching overrides block.