Conversation
- Resolve symlinks on CWD in repoConfigPath and localConfigPaths so trust-boundary comparisons are consistent (both sides now resolved) - Remove redundant duplicate RequireSecureURL check after profile merge - Fix isConfigCmd docstring placement (was fused with transformCobraError)
There was a problem hiding this comment.
Pull request overview
Follow-up security hardening and cleanup after #161, focused on making config trust-boundary checks robust against symlinked working directories and removing/repairing small correctness and documentation issues.
Changes:
- Resolve symlinks for CWD before trust-boundary comparisons in repo/local config discovery.
- Remove redundant HTTPS validation re-check after profile application.
- Fix comment placement so
isConfigCmdandtransformCobraErrordocstrings are correctly attached.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/config/config.go | Resolves symlinks for CWD to strengthen trust-boundary comparisons when discovering repo/local config paths. |
| internal/cli/root.go | Removes dead/redundant RequireSecureURL logic and fixes docstring placement for helper functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
repoConfigPath and localConfigPaths now return empty/nil when EvalSymlinks(cwd) fails, rather than falling back to the unresolved path. Prevents trust-boundary bypass under unusual filesystem conditions.
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.
Summary
Addresses the 3 unresolved review threads from #161 (second Copilot review pass after merge):
repoConfigPathandlocalConfigPathsnow resolve symlinks on CWD before comparing against the (already-resolved) boundary. Prevents the walk from escaping the trust boundary on systems where$HOMEcontains symlinks (e.g./home/user→/data/users/user).RequireSecureURLcall — The innerif profileName != ""re-check was dead code;cfg.BaseURLalready reflects the post-profile value by that point.isConfigCmddocstring — Was concatenated onto thetransformCobraErrorcomment block. Now standalone above its function.Test plan
make checkpasses (fmt, vet, lint, unit tests, e2e)TestRepoConfigPath_StopsAtHome,TestLocalConfigPaths_*tests exercise the symlink-resolved paths