Skip to content

chore: remove unused go-git dependency and transitive security advisory#302

Merged
mufeez-amjad merged 1 commit into
smtg-ai:mainfrom
paytonagreen:fix/bump-go-billy-v5.9.0
Jun 17, 2026
Merged

chore: remove unused go-git dependency and transitive security advisory#302
mufeez-amjad merged 1 commit into
smtg-ai:mainfrom
paytonagreen:fix/bump-go-billy-v5.9.0

Conversation

@paytonagreen

Copy link
Copy Markdown
Contributor

Summary

  • github.com/go-git/go-git/v5 was declared as a direct dependency in go.mod but is not imported anywhere in the codebase — all git operations use exec.Command to shell out to the system git binary.
  • go-git's transitive dependency github.com/go-git/go-billy/v5 was pinned at v5.6.2, which is affected by a security advisory requiring v5.9.0 or later.
  • Running go mod tidy removes go-git and its full transitive closure (including go-billy, go-winio, ProtonMail/go-crypto, cloudflare/circl, golang.org/x/crypto, golang.org/x/net, and others), resolving the advisory by eliminating the dependency entirely.

Changes

  • go.mod: removed go-git/go-git direct dep and 14 indirect deps that came with it
  • go.sum: updated accordingly

Test plan

  • go build ./... passes
  • go vet ./... passes
  • gofmt -l . reports no files
  • Existing tests pass (go test ./...)

🤖 Generated with Claude Code

go-git/go-git was listed as a direct dependency but was not imported
anywhere in the codebase — all git operations shell out via exec.Command.
Running go mod tidy removes go-git and its full transitive closure,
including go-git/go-billy/v5 v5.6.2 which had an outstanding security
advisory requiring v5.9.0 or later.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@paytonagreen

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@paytonagreen

Copy link
Copy Markdown
Contributor Author

Flagging the security context for this PR for maintainer awareness. The dependency removed here — github.com/go-git/go-billy/v5 v5.6.2 — was carrying two published advisories, both patched in v5.9.0:

GHSA-qw64-3x98-g7q2 / CVE-2026-44973 — Path traversal (High, CVSS 8.1): crafted paths using .. can escape intended base directories via osfs.ChrootOS.
GHSA-m3xc-h892-ggx6 / CVE-2026-44740 — Uncontrolled recursion / infinite loop (Medium, CVSS 6.5): malformed input can cause panics or resource exhaustion via missing cycle detection in symlink resolution.

Since go-git is not imported anywhere in the codebase (all git operations shell out via exec.Command), the fix here is a full removal rather than a version bump — eliminating the advisory surface entirely. go build ./... and go test ./... both pass cleanly after the change.

@jayshrivastava @mufeez-amjad — would appreciate a review when you have a moment.

@mufeez-amjad mufeez-amjad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the cleanup! Indeed, we switched from go-git to using the git binary via the shell.

@mufeez-amjad mufeez-amjad self-requested a review June 17, 2026 04:58

@mufeez-amjad mufeez-amjad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, can you paste the output of:

go mod why -m github.com/kr/pretty
go mod why -m github.com/rogpeppe/go-internal
go mod why -m gopkg.in/check.v1

Just want to confirm these are only indirect/test dependency graph changes from go mod tidy.

@paytonagreen

Copy link
Copy Markdown
Contributor Author

For sure! Here you go:

github.com/kr/pretty

claude-squad/app
claude-squad/app.test
github.com/stretchr/testify/assert
github.com/stretchr/testify/assert/yaml
gopkg.in/yaml.v3
gopkg.in/yaml.v3.test
gopkg.in/check.v1
github.com/kr/pretty

github.com/rogpeppe/go-internal

claude-squad/app
claude-squad/app.test
github.com/stretchr/testify/assert
github.com/stretchr/testify/assert/yaml
gopkg.in/yaml.v3
gopkg.in/yaml.v3.test
gopkg.in/check.v1
github.com/kr/pretty
github.com/rogpeppe/go-internal/fmtsort

gopkg.in/check.v1

claude-squad/app
claude-squad/app.test
github.com/stretchr/testify/assert
github.com/stretchr/testify/assert/yaml
gopkg.in/yaml.v3
gopkg.in/yaml.v3.test
gopkg.in/check.v1

@mufeez-amjad mufeez-amjad merged commit b27ded3 into smtg-ai:main Jun 17, 2026
7 of 8 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants