By allowing Open(at)InRoot to opt-out of the extra work done by MkdirAll
to do the necessary "partial lookups", Open(at)InRoot now does less work
for both implementations (resulting in a many-fold decrease in the number of
operations for openat2, and a modest improvement for non-openat2) and is
far more guaranteed to match the correct openat2(RESOLVE_IN_ROOT)
behaviour.
We now use readlinkat(fd, "") where possible. For Open(at)InRoot this
effectively 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 /proc handle). Unfortunately Reopen is still
potentially vulnerable to those kinds of somewhat-esoteric attacks.
Several improvements were made to the errors returned by Open(at)InRoot and
MkdirAll when dealing with invalid paths under the emulated (ie.
non-openat2) implementation. Previously, some paths would return the wrong
error (ENOENT when the last component was a non-directory), and other paths
would 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 a
consistency fix (most users are going to be using openat2 anyway).
However, it does introduce a new *os.File-based API which is much safer
to use for most usecases. These are adapted from [libpathrs][1] 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.File handle to the path. Note that the file handle returned by
OpenInRoot 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.
By allowing Open(at)InRoot to opt-out of the extra work done by MkdirAll
to do the necessary "partial lookups", Open(at)InRoot now does less work
for both implementations (resulting in a many-fold decrease in the number of
operations for openat2, and a modest improvement for non-openat2) and is
far more guaranteed to match the correct openat2(RESOLVE_IN_ROOT)
behaviour.
We now use readlinkat(fd, "") where possible. For Open(at)InRoot this
effectively 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 /proc handle). Unfortunately Reopen is still
potentially vulnerable to those kinds of somewhat-esoteric attacks.
Several improvements were made to the errors returned by Open(at)InRoot and
MkdirAll when dealing with invalid paths under the emulated (ie.
non-openat2) implementation. Previously, some paths would return the wrong
error (ENOENT when the last component was a non-directory), and other paths
would 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 a
consistency fix (most users are going to be using openat2 anyway).
[0.3.0] - 2024-07-11
Added
A new set of *os.File-based APIs have been added. These are adapted from
[libpathrs][] and we strongly suggest using them if possible (as they provide
far more protection against attacks than SecureJoin):
Open(at)InRoot resolves a path inside a rootfs and returns an *os.File
handle to the path. Note that the handle returned 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][open.2])
Reopen takes an O_PATH file handle and safely re-opens it to upgrade
it to a regular handle. This can also be used with non-O_PATH handles,
but O_PATH is the most obvious application.
MkdirAll is an implementation of os.MkdirAll that is safe to use to
Bumps the go-modules group with 24 updates in the / directory:
0.18.2
0.18.7
1.0.0
1.0.1
1.3.2
1.4.0
1.5.5
1.5.6
0.11.7
0.12.6
1.3.7
1.4.0
0.2.4
0.3.1
0.8.1
0.8.2
1.4.3
1.4.5
5.11.0
5.12.0
1.4.0
1.5.0
1.17.7
1.17.9
0.0.0-20230301153543-ba94b245509b
0.1.1
0.0.15
0.0.16
0.5.0
0.6.0
0.1.0
0.3.0
0.3.0
0.4.0
3.24.1
3.24.5
1.3.1
1.4.0
0.5.3
0.5.5
1.6.0
1.7.0
2.15.1
2.19.0
0.3.13
0.3.14
0.5.3
0.5.4
Updates
github.com/paketo-buildpacks/occam
from 0.18.2 to 0.18.7Release notes
Sourced from github.com/paketo-buildpacks/occam's releases.
... (truncated)
Commits
aff3030
Buildpack packaging should always target linux7b8692d
Updates go mod toolchain version to 1.22.4ddf2781
Bump github.com/docker/dockere9fee75
Adds support of buildpackages in buildpack store and updates freezer (#302)dda57be
Updating github-configf0b937b
Use stable go version everywhere.354d744
Bump to go 1.2164bc107
Updating github-configd00fe4b
Bump github.com/docker/docker37502e4
Bump github.com/testcontainers/testcontainers-go from 0.30.0 to 0.31.0Updates
github.com/paketo-buildpacks/packit/v2
from 2.12.0 to 2.14.0Release notes
Sourced from github.com/paketo-buildpacks/packit/v2's releases.
Commits
13393ec
Support reading service bindings from VCAP_SERVICES env var (#566)35d8f76
Bump github.com/onsi/gomega from 1.33.0 to 1.33.1ce376b7
Fixes mirror bug when originalHost is excluded (#569)4c9f338
Allows users to set a dependency mirror (#563)4e9c21d
Bump github.com/onsi/gomega from 1.32.0 to 1.33.0dd77ec5
Bump github.com/ulikunitz/xz from 0.5.11 to 0.5.1295b8056
Bump github.com/onsi/gomega from 1.31.1 to 1.32.0777a503
Bump github.com/stretchr/testify from 1.8.4 to 1.9.0c1b785b
Bump github.com/google/uuid from 1.5.0 to 1.6.0b31dc83
Bump github.com/onsi/gomega from 1.31.0 to 1.31.1Updates
dario.cat/mergo
from 1.0.0 to 1.0.1Release notes
Sourced from dario.cat/mergo's releases.
Commits
59ea6a9
Merge pull request #251 from joshkaplinsky/joshkaplinsky/without-dereference-...96f24af
Merge pull request #253 from vsemichev/master2f1a615
fixes issue #187. adds test to verify the fix.4da170b
fixes issue #187. attempt #3a13a117
fixes issue #187. attempt #26b830ff
fixes issue #187f33862a
WithoutDereference should respect structscde9f0e
Merge pull request #246 from darccio/darccio/v1-frozenf1e2fe5
chore: frozen v17f7b4af
Update FUNDING.ymlUpdates
github.com/BurntSushi/toml
from 1.3.2 to 1.4.0Release notes
Sourced from github.com/BurntSushi/toml's releases.
Commits
1e2c053
Undeprecate PrimitiveDecode and MetaData.PrimitiveDecode()f8f7e48
Update toml-test9a80667
Add -json flag to tomlv3203540
fuzz: move fuzz_targets from oss-fuzz (#406)77ce858
Add Marshal Function (#405)0e879cb
Fix panic when trying to set subkey for a value that's not a tablec299e75
Update toml-test4223137
Fix inline tables with dotted keys inside inline arrays (#400)45e7e49
Update toml-testc320c2d
Fix utf8.RuneError testUpdates
github.com/DataDog/zstd
from 1.5.5 to 1.5.6Release notes
Sourced from github.com/DataDog/zstd's releases.
Commits
b52f603
Merge pull request #143 from DataDog/viq111/1.5.6cf4778e
Update Readme for 1.5.6ed87d43
Update vendored zstd to 1.5.6dd7b332
Merge pull request #136 from colinlyguo/fix-readmebeb4dfd
Merge pull request #141 from DataDog/sfluor-patch-1e75a26a
Update upperBound ratio when guessing the required decompression buffer sizec9a5141
fix readme869dae0
Merge pull request #132 from DataDog/viq111/bulk-fix-highlycompressed-payloadsbf7b920
[bulk] Add extra empty payload decompression test9c0d33f
[bulk] Fix namingUpdates
github.com/ForestEckhardt/freezer
from 0.0.12 to 0.1.0Release notes
Sourced from github.com/ForestEckhardt/freezer's releases.
Commits
a57bf55
Updates fetchers to create buildpackagesUpdates
github.com/Microsoft/hcsshim
from 0.11.7 to 0.12.6Release notes
Sourced from github.com/Microsoft/hcsshim's releases.
... (truncated)
Commits
f922f2a
Omnibus dependency updates (#2051)7d25ce2
Update module versions85a5a57
drop usage of deprecated package/methodsd4b1cc0
Bump opa/containerd to latest versions6a5ebd3
Upgrade deps to resolve CVEs (#2225)4f46058
Omnibus dependency update (#2166)e970943
Modifying network flag EnableIov.4f77a09
Hcsshim wrapper over HNS API needed for exclusion of management mac addresses...3b5bd8a
[release/0.12] vendor: github.com/containerd/containerd v17.1840cdbc8
Adding state attribute to the HNSEndpoint struct to support hyperv containers...Updates
github.com/cenkalti/backoff/v4
from 4.2.1 to 4.3.0Commits
720b789
remove travis badge from readmea83af7f
feat(backoff): Add functional options for ExponentialBackOff Closes #136Updates
github.com/cloudflare/circl
from 1.3.7 to 1.4.0Release notes
Sourced from github.com/cloudflare/circl's releases.
... (truncated)
Commits
c311e46
Preparing for release v1.4.062385a8
Add ML-KEM decapsulation key check.2b4626d
Add ML-KEM (FIPS 203).d26845f
eddilithium3: fix typos75b28ed
Preparing CIRCL release v1.3.99e7c49b
Detects invalid encodings of bls12381 elements.5f94471
Test for invalid encodings of BLS12381.456fe41
dilithium: fix typo4bb5601
Serializing ciphertext with 32-bit prefixes.a4252c7
Test functions working with ciphertext.Updates
github.com/cyphar/filepath-securejoin
from 0.2.4 to 0.3.1Release notes
Sourced from github.com/cyphar/filepath-securejoin's releases.
... (truncated)
Changelog
Sourced from github.com/cyphar/filepath-securejoin's changelog.
... (truncated)
Commits
ce7b28a
VERSION: release v0.3.1a2c14f8
CHANGELOG: add readlinkat(fd, "") shout-out4ea279f
merge #22 into cyphar/filepath-securejoin:main16e1bec
CHANGELOG: add initial changelog with current history2404ffb
merge #21 into cyphar/filepath-securejoin:mainf29b7a4
lookup: handle // and trailing slash components correctlyecd61ca
merge #19 into cyphar/filepath-securejoin:main38b1220
procfs: refactor statx mnt_id logic45c4415
procfs: use readlink(fd, "") for magic-linksedab538
merge #17 into cyphar/filepath-securejoin:mainUpdates
github.com/docker/docker-credential-helpers
from 0.8.1 to 0.8.2Release notes
Sourced from github.com/docker/docker-credential-helpers's releases.
Commits
6b9df3e
Merge pull request #323 from thaJeztah/pass_simplify_getdc10c50
Merge pull request #317 from docker/dependabot/github_actions/softprops/actio...896eb37
build(deps): bump softprops/action-gh-release to 2.0.5a14669f
pass: Get: remove redundant stat74840b3
Merge pull request #322 from thaJeztah/pass_dryd3ef442
pass: add utilities for encoding/decoding serverURLf64d6b1
Merge pull request #321 from thaJeztah/fix_pass_errors1bb9aa3
pass: return correct error, and ignore empty stores on list73b9e5d
Merge pull request #320 from thaJeztah/update_gha0c43fed
update to go1.21.10Updates
github.com/gabriel-vasile/mimetype
from 1.4.3 to 1.4.5Release notes
Sourced from github.com/gabriel-vasile/mimetype's releases.
Commits
b36b70f
remove exe from testdata (#561)e802551
Bump the github-actions group across 1 directory with 3 updates (#560)f003e99
Bump golang.org/x/net in the gomod group across 1 directory (#552)e0c5c59
reduce project size by moving mimetype.gif to testdata (#548)f296c1b
alias rtf to application/rtf (#547)8329892
Updating RTF Magic number to match <https://www.iana.org/assignments/media-ty... _Description has been truncated_