Skip to content

fix(security): harden server-side LFS snapshots - #416

Merged
stuartwdouglas merged 1 commit into
block:mainfrom
stuartwdouglas:security/harden-lfs-snapshots
Oct 28, 2026
Merged

stuartwdouglas merged 1 commit into
block:mainfrom
stuartwdouglas:security/harden-lfs-snapshots

Conversation

@stuartwdouglas

Copy link
Copy Markdown
Contributor

No description provided.

@stuartwdouglas
stuartwdouglas requested a review from a team as a code owner October 28, 2026 02:20
@stuartwdouglas
stuartwdouglas requested review from alecthomas and removed request for a team October 28, 2026 02:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T02:26:27.115467Z e58b9b4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@stuartwdouglas
stuartwdouglas enabled auto-merge (squash) October 28, 2026 02:21
@stuartwdouglas
stuartwdouglas merged commit 48fdc7b into block:main Oct 28, 2026
7 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +117 to 119
if err := gitLFSVersionCheck(); err != nil {
return nil, err
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants