chore(deps): update module github.com/cyphar/filepath-securejoin to v0.3.6 #6066
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.
This PR contains the following updates:
v0.2.4->v0.3.6Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
cyphar/filepath-securejoin (github.com/cyphar/filepath-securejoin)
v0.3.6Compare Source
This release lowers the minimum Go version to Go 1.18 as well as some
library dependencies, in order to make it easier for folks that need to
backport patches using the new filepath-securejoin API onto branches
that are stuck using old Go compilers. For users using Go >= 1.21, this
release contains no functional changes.
The minimum Go version requirement for
filepath-securejoinis now Go 1.18(we use generics internally).
For reference,
[email protected]somewhat-arbitrarily bumped theGo version requirement to 1.21.
While we did make some use of Go 1.21 stdlib features (and in principle Go
versions <= 1.21 are no longer even supported by upstream anymore), some
downstreams have complained that the version bump has meant that they have to
do workarounds when backporting fixes that use the new
filepath-securejoinAPI onto old branches. This is not an ideal situation, but since using this
library is probably better for most downstreams than a hand-rolled
workaround, we now have compatibility shims that allow us to build on older
Go versions.
Lower minimum version requirement for
golang.org/x/systov0.18.0(weneed the wrappers for
fsconfig(2)), which should also make backportingpatches to older branches easier.
Signed-off-by: Aleksa Sarai [email protected]
v0.3.5Compare Source
This release primarily includes a fix for an issue involving two
programs racing to MkdirAll the same directory, which caused a
regression with BuildKit.
MkdirAllwill now no longer return anEEXISTerror if two racingprocesses are creating the same directory. We will still verify that the path
is a directory, but this will avoid spurious errors when multiple threads or
programs are trying to
MkdirAllthe same path. opencontainers/runc#4543Signed-off-by: Aleksa Sarai [email protected]
v0.3.4Compare Source
This release primarily includes a fix that blocked using
filepath-securejoin in Kubernetes.
import "testing"in non-
_test.gocode, which made some downstreams like Kubernetes unhappy.This has been fixed. (#32)
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
v0.3.3Compare Source
This release primarily includes fixes for spurious errors we hit when
checking that directories created by MkdirAll "look right". Upon further
consideration, these checks were fundamentally buggy and didn't offer
any practical protection anyway.
MkdirAllhas been removed. Thiswas originally intended to protect against some theoretical attacks but upon
further consideration these protections don't actually buy us anything and
they were causing spurious errors with more complicated filesystem setups.
MkdirAllhas also beenremoved. This was not causing us issues yet, but some pseudofilesystems (such
as
cgroup) create non-empty directories and so this logic would've beenwrong for such cases.
Thanks to all of the contributors who made this release possible:
Signed-off-by: Aleksa Sarai [email protected]
v0.3.2Compare Source
This release includes a few fixes for MkdirAll when dealing with S_ISUID
and S_ISGID, to solve a regression runc hit when switching to MkdirAll.
Passing the S_ISUID or S_ISGID modes to MkdirAllInRoot will now return
an explicit error saying that those bits are ignored by mkdirat(2). In
the past a different error was returned, but since the silent ignoring
behaviour is codified in the man pages a more explicit error seems
apt. While silently ignoring these bits would be the most compatible
option, it could lead to users thinking their code sets these bits
when it doesn't. Programs that need to deal with compatibility can
mask the bits themselves. (#23, #25)
If a directory has S_ISGID set, then all child directories will have
S_ISGID set when created and a different gid will be used for any
inode created under the directory. Previously, the "expected owner and
mode" validation in securejoin.MkdirAll did not correctly handle this.
We now correctly handle this case. (#24, #25)
Signed-off-by: Aleksa Sarai [email protected]
v0.3.1Compare Source
By allowing
Open(at)InRootto opt-out of the extra work done byMkdirAllto do the necessary "partial lookups",
Open(at)InRootnow does less workfor both implementations (resulting in a many-fold decrease in the number of
operations for
openat2, and a modest improvement for non-openat2) and isfar more guaranteed to match the correct
openat2(RESOLVE_IN_ROOT)behaviour.
We now use
readlinkat(fd, "")where possible. ForOpen(at)InRootthiseffectively just means that we no longer risk getting spurious errors during
rename races. However, for our hardened procfs handler, this in theory should
prevent mount attacks from tricking us when doing magic-link readlinks (even
when using the unsafe host
/prochandle). UnfortunatelyReopenis stillpotentially vulnerable to those kinds of somewhat-esoteric attacks.
Technically this will only work on post-2.6.39 kernels
but it seems incredibly unlikely anyone is using
filepath-securejoinon apre-2011 kernel.
Several improvements were made to the errors returned by
Open(at)InRootandMkdirAllwhen dealing with invalid paths under the emulated (ie.non-
openat2) implementation. Previously, some paths would return the wrongerror (
ENOENTwhen the last component was a non-directory), and other pathswould be returned as though they were acceptable (trailing-slash components
after a non-directory would be ignored by
Open(at)InRoot).These changes were done to match
openat2's behaviour and purely is aconsistency fix (most users are going to be using
openat2anyway).Signed-off-by: Aleksa Sarai [email protected]
v0.3.0Compare Source
This release contains no changes to SecureJoin.
However, it does introduce a new
*os.File-based API which is much saferto use for most usecases. These are adapted from libpathrs and are
the bare minimum to be able to operate more safely on an untrusted
rootfs where an attacker has write access (something that SecureJoin
cannot protect against). The new APIs are:
OpenInRoot, which resolves a path inside a rootfs and returns an
*os.Filehandle to the path. Note that the file handle returned byOpenInRoot is an O_PATH handle, which cannot be used for reading or
writing (as well as some other operations -- see open(2) for more
details).
Reopen, which takes an O_PATH file handle and safely re-opens it to
"upgrade" it to a regular handle.
MkdirAll, which is a safe implementation of os.MkdirAll that can be
used to create directory trees inside a rootfs.
As these are new APIs, it is possible they may change in the future.
However, they should be safe to start migrating to as we have extensive
tests ensuring they behave correctly and are safe against various races
and other attacks.
Signed-off-by: Aleksa Sarai [email protected]
v0.2.5Compare Source
This release makes some minor improvements to SecureJoin:
Some changes were made to how lexical components are handled during
resolution. There is no change in behaviour, and both implementations
are safe, however the newer implementation is much easier to reason
about.
The error returned when a symlink loop has been detected will now
reference the correct path. #10
Signed-off-by: Aleksa Sarai [email protected]
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.