Repository navigation
fix(security): harden server-side LFS snapshots - #416
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e58b9b4357
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if _, err := exec.LookPath("git-lfs"); err != nil { | ||
| return errors.New("git-lfs is required but not found in PATH") | ||
| } | ||
| gitLFSVersion, err := exec.CommandContext(context.Background(), "git-lfs", "version").CombinedOutput() |
There was a problem hiding this comment.
Validate the git-lfs binary that Git will execute
On installations where Git has an older git-lfs in its exec path but PATH contains a 3.8.1 binary, this validates the PATH binary while the later git ... lfs fetch in snapshot.go invokes Git's external subcommand and can select the older, explicitly unsupported binary. I confirmed the split resolution; Git's own git --help exposes --exec-path[=<path>] and git help -a lists lfs under “External commands.” Check git lfs version (or execute the checked path directly for the fetch) so the security floor applies to the executable actually used.
Useful? React with 👍 / 👎.
| if err := gitLFSVersionCheck(); err != nil { | ||
| return nil, err | ||
| } |
There was a problem hiding this comment.
Gate the git-lfs requirement on enabled snapshots
When snapshot-interval is left at its documented default of 0, this unconditional check makes the entire Git strategy fail to initialize on hosts without git-lfs 3.8.1 or newer, even though LFS snapshot jobs are scheduled only behind SnapshotInterval > 0 and the ordinary Git proxy never launches git-lfs. This regresses binary/non-Docker deployments that intentionally disable snapshots; gate the requirement alongside the existing tar/pzstd checks.
Useful? React with 👍 / 👎.
No description provided.