GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — v5: git: Stop validating symlink target paths by pjbgf · Pull Request #2116 · go-git/go-git

Conversation

@pjbgf

@pjbgf pjbgf commented May 12, 2026

Copy link
Copy Markdown
Member

The Symlink wrapper was running validPath on both the target and the link. Targets are an opaque string the kernel resolves at use time, so legitimate worktrees commonly contain symlinks pointing to absolute paths or escaping via "..". Validating them as worktree paths rejected those checkouts. Containment is enforced on the link name, which is where the wrapper actually controls placement.

Reverts 0ae66bd, which added validation on symlink target which does not align with upstream.

Backport of: #2114.
Fixes: #2107.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings May 12, 2026 14:04
Copilot started reviewing on behalf of pjbgf May 12, 2026 14:06
View session
Copilot AI reviewed May 12, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts symlink target path validation in the worktree filesystem wrapper, aligning behavior with upstream Git and allowing repositories containing symlinks whose targets are absolute paths or contain .. to be checked out successfully (while still enforcing containment via validation of the symlink name / link path).

Changes:

  • Stop running validPath on the symlink target in worktreeFilesystem.Symlink, validating only the link path.
  • Add a regression test ensuring checkout succeeds and preserves symlink targets that are relative, absolute, or ..-escaping.
  • Minor whitespace cleanup in worktree_test.go.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
worktree_fs.go Updates symlink creation validation to only constrain the link path, not the target string.
worktree_test.go Adds coverage for checking out symlinks with arbitrary targets (absolute / ..), preventing regressions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pjbgf
git: Stop validating symlink target paths
f0709b3
The Symlink wrapper was running validPath on both the target and the
link. Targets are an opaque string the kernel resolves at use time, so
legitimate worktrees commonly contain symlinks pointing to absolute
paths or escaping via ... Validating them as worktree paths rejected
those checkouts. Containment is enforced on the link name, which is
where the wrapper actually controls placement.

Assisted-by: Claude Opus 4.7 <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
@pjbgf
pjbgf force-pushed the symlink-v5 branch from a566941 to f0709b3 Compare May 12, 2026 14:15
@pjbgf pjbgf changed the title git: Stop validating symlink target paths v5: git: Stop validating symlink target paths May 12, 2026
hiddeco
hiddeco approved these changes May 12, 2026
View reviewed changes
@pjbgf
pjbgf merged commit 170b881 into go-git:releases/v5.x May 12, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@pjbgf
pjbgf deleted the symlink-v5 branch May 12, 2026 14:26
Maks1mS pushed a commit to stplr-dev/stplr that referenced this pull request May 20, 2026
Renovate Bot ALT Linux Space
fix(deps): update module github.com/go-git/go-git/v5 to v5.19.1 (#435)
40afaeb
This PR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) | require | patch | `v5.19.0` → `v5.19.1` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-git/go-git/badge)](https://securityscorecards.dev/viewer/?uri=github.com/go-git/go-git) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/23) for more information.

---

### Release Notes

<details>
<summary>go-git/go-git (github.com/go-git/go-git/v5)</summary>

### [`v5.19.1`](https://github.com/go-git/go-git/releases/tag/v5.19.1)

[Compare Source](go-git/go-git@v5.19.0...v5.19.1)

#### What's Changed

- v5: plumbing: transport/ssh, Shell-quote path by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2068](go-git/go-git#2068)
- v5: git: submodule, Fix relative URL resolution by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2070](go-git/go-git#2070)
- v5: git: submodule, canonical remote for relative URLs by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2074](go-git/go-git#2074)
- v5: git: submodule, error on remote without URLs by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2078](go-git/go-git#2078)
- v5: plumbing: format/idxfile, Validate offset64 indices by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2084](go-git/go-git#2084)
- v5: \*: Reject malformed variable-length integers by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2092](go-git/go-git#2092)
- v5: plumbing: format/packfile, Tighten delta validation by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2091](go-git/go-git#2091)
- v5: Add `worktreeFilesystem` wrapper for worktree and hardening by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2100](go-git/go-git#2100)
- v5: config: validate submodule names by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2082](go-git/go-git#2082)
- build: Update module github.com/go-git/go-git/v5 to v5.19.0 \[SECURITY] (releases/v5.x) by [@&#8203;go-git-renovate](https://github.com/go-git-renovate)\[bot] in [#&#8203;2111](go-git/go-git#2111)
- v5: git: Allow MkdirAll on worktree-root paths by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2117](go-git/go-git#2117)
- v5: git: Stop validating symlink target paths by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;2116](go-git/go-git#2116)
- v5: plumbing: format decoder input bounds and contracts by [@&#8203;hiddeco](https://github.com/hiddeco) in [#&#8203;2125](go-git/go-git#2125)
- plumbing: format/packfile, cap delta chain depth in parser by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;2137](go-git/go-git#2137)

**Full Changelog**: <go-git/go-git@v5.19.0...v5.19.1>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday (`* 0-4,22-23 * * 1-5`)
  - Only on Sunday and Saturday (`* * * * 0,6`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNzAuMjIiLCJ1cGRhdGVkSW5WZXIiOiI0My4xNzAuMjIiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIktpbmQvRGVwZW5kZW5jaWVzIl19-->

Reviewed-on: https://altlinux.space/stapler/stplr/pulls/435
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@hiddeco hiddeco hiddeco approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@pjbgf @hiddeco
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.