Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 90470cf

Browse files
committed
vendor: Bump docker/cli
This allows us to rely on the upstream yaml.v2 library as it includes a mitigation for malicious YAML files (see: kubernetes/kubernetes#83253). Signed-off-by: Christopher Crone <[email protected]>
1 parent 93e0d2b commit 90470cf

File tree

9 files changed

+73
-66
lines changed

9 files changed

+73
-66
lines changed

Gopkg.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ required = ["github.com/wadey/gocovmerge"]
3737

3838
[[override]]
3939
name = "github.com/docker/cli"
40-
revision = "83751b978155dc889c35e0e49654f76e7cf8d951"
40+
revision = "d83cd90464377d4164c8f70248d064b979e5ca98"
4141

4242
[[override]]
4343
name = "github.com/deislabs/cnab-go"
@@ -96,13 +96,6 @@ required = ["github.com/wadey/gocovmerge"]
9696
name = "k8s.io/client-go"
9797
revision = "kubernetes-1.14.1"
9898

99-
# This is using a fork waiting for go-yaml/yaml#375 to be merged
100-
# This PR allows to set a max decoded value, thus not being exposed to yaml bombs
101-
[[override]]
102-
name = "gopkg.in/yaml.v2"
103-
source = "https://github.com/simonferquel/yaml"
104-
revision = "c86e64ed9581b7588e736f0c3e6ecc02cc22996e"
105-
10699
[[override]]
107100
name = "github.com/opencontainers/runtime-spec"
108101
revision = "29686dbc5559d93fb1ef402eeda3e35c38d75af4"

internal/yaml/yaml.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@ import (
77
"gopkg.in/yaml.v2"
88
)
99

10-
const (
11-
maxDecodedValues = 1000000
12-
)
13-
1410
// Unmarshal decodes the first document found within the in byte slice
1511
// and assigns decoded values into the out value.
1612
//
1713
// See gopkg.in/yaml.v2 documentation
1814
func Unmarshal(in []byte, out interface{}) error {
19-
d := yaml.NewDecoder(bytes.NewBuffer(in), yaml.WithLimitDecodedValuesCount(maxDecodedValues))
15+
d := yaml.NewDecoder(bytes.NewBuffer(in))
2016
err := d.Decode(out)
2117
if err == io.EOF {
2218
return nil
@@ -37,5 +33,5 @@ func Marshal(in interface{}) ([]byte, error) {
3733
//
3834
// See gopkg.in/yaml.v2 documentation
3935
func NewDecoder(r io.Reader) *yaml.Decoder {
40-
return yaml.NewDecoder(r, yaml.WithLimitDecodedValuesCount(maxDecodedValues))
36+
return yaml.NewDecoder(r)
4137
}

internal/yaml/yaml_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ h: &h [*g,*g,*g,*g,*g,*g,*g,*g,*g]
2121
i: &i [*h,*h,*h,*h,*h,*h,*h,*h,*h]`)
2222
d := NewDecoder(bytes.NewBuffer(data))
2323
err := d.Decode(&v)
24-
assert.ErrorContains(t, err, "yaml: exceeded max number of decoded values (1000000)")
24+
assert.ErrorContains(t, err, "yaml: document contains excessive aliasing")
2525
}
2626

2727
func TestUnmarshalYamlBomb(t *testing.T) {
@@ -37,5 +37,5 @@ g: &g [*f,*f,*f,*f,*f,*f,*f,*f,*f]
3737
h: &h [*g,*g,*g,*g,*g,*g,*g,*g,*g]
3838
i: &i [*h,*h,*h,*h,*h,*h,*h,*h,*h]`)
3939
err := Unmarshal(data, &v)
40-
assert.ErrorContains(t, err, "yaml: exceeded max number of decoded values (1000000)")
40+
assert.ErrorContains(t, err, "yaml: document contains excessive aliasing")
4141
}

vendor/github.com/docker/cli/cli/config/config.go

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/yaml.v2/decode.go

Lines changed: 18 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/yaml.v2/encode.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/yaml.v2/resolve.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/gopkg.in/yaml.v2/yaml.go

Lines changed: 6 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)