v5: General Improvements#203
Merged
Merged
Conversation
Signed-off-by: Paulo Gomes <paulo@entire.io>
Signed-off-by: Paulo Gomes <paulo@entire.io>
Signed-off-by: Paulo Gomes <paulo@entire.io>
Use Lstat when RemoveAll falls back to directory traversal after an initial Remove failure. This prevents a symlink from being followed and recursed into when Remove fails. Signed-off-by: Paulo Gomes <paulo@entire.io>
There was a problem hiding this comment.
Pull request overview
This PR tightens filesystem path handling and symlink behavior across helpers, with a focus on making chroot boundary enforcement more robust and preventing incorrect mountpoint routing. It also adds targeted regression tests to validate the updated semantics.
Changes:
- Update
chroothelper path resolution to detect and block symlink-based boundary crossings (including loop handling). - Improve
mounthelper mountpoint detection to avoid treating same-prefix paths (e.g.foovsfoobar) as inside the mount. - Adjust
util.RemoveAllto avoid recursing into symlinks (preferringLstatwhen available) and add/extend tests for the new behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| util/util.go | Makes RemoveAll safer around symlinks by using an lstat helper and avoiding recursion into symlink paths. |
| util/util_test.go | Minor formatting cleanup in tests (no behavior change). |
| test/fs.go | Updates chroot+symlink conformance tests to validate Lstat vs Stat boundary behavior. |
| memfs/memory_test.go | Adds regression tests for chroot boundary enforcement via symlinks and for symlink loop detection. |
| helper/mount/mount.go | Fixes mountpoint matching logic to require an exact match or a path-separator boundary; also corrects a typo in a comment (partially). |
| helper/mount/mount_test.go | Adds coverage to ensure mountpoint-prefix paths are not misrouted, and tests the updated mountpoint predicate. |
| helper/chroot/chroot.go | Introduces symlink-following resolution with boundary checks and a symlink-follow limit; adjusts Stat to ensure returned FileInfo.Name() matches the requested path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Paulo Gomes <paulo@entire.io>
Maks1mS
pushed a commit
to stplr-dev/stplr
that referenced
this pull request
May 10, 2026
This PR contains the following updates: | Package | Type | Update | Change | OpenSSF | |---|---|---|---|---| | [github.com/go-git/go-billy/v5](https://github.com/go-git/go-billy) | require | minor | `v5.8.0` → `v5.9.0` | [](https://securityscorecards.dev/viewer/?uri=github.com/go-git/go-billy) | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/23) for more information. --- ### Release Notes <details> <summary>go-git/go-billy (github.com/go-git/go-billy/v5)</summary> ### [`v5.9.0`](https://github.com/go-git/go-billy/releases/tag/v5.9.0) [Compare Source](go-git/go-billy@v5.8.0...v5.9.0) #### What's Changed - Use path.Clean instead of filepath.Clean in iofs.Open by [@​puerco](https://github.com/puerco) in [#​197](go-git/go-billy#197) - Deprecate ChrootOS in favour of BoundOS by [@​pjbgf](https://github.com/pjbgf) in [#​201](go-git/go-billy#201) - General Improvements by [@​pjbgf](https://github.com/pjbgf) in [#​203](go-git/go-billy#203) - osfs: ChrootOS eval baseDir on creation by [@​pjbgf](https://github.com/pjbgf) in [#​205](go-git/go-billy#205) - Run go-git tests as part of integration tests by [@​pjbgf](https://github.com/pjbgf) in [#​206](go-git/go-billy#206) **Full Changelog**: <go-git/go-billy@v5.8.0...v5.9.0> </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 [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMzIuMyIsInVwZGF0ZWRJblZlciI6IjQzLjEzMi4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY2llcyJdfQ==--> Reviewed-on: https://altlinux.space/stapler/stplr/pulls/426
|
Does any of these commits fix CVE-2026-44740? |
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.
Back-port of #204.