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

Commit 2f34b47

Browse files
author
Vincent Demeester
authored
Merge pull request #346 from vdemeester/use-patched-yaml-package
Make docker/app not exposed to yaml bomb
2 parents 347faec + f9dbc48 commit 2f34b47

19 files changed

Lines changed: 145 additions & 27 deletions

File tree

Gopkg.lock

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

Gopkg.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ required = ["github.com/wadey/gocovmerge"]
7373
name = "google.golang.org/grpc"
7474
revision = "v1.3.0"
7575

76+
# This is using a fork waiting for go-yaml/yaml#375 to be merged
77+
# This PR allows to set a max decoded value, thus not being exposed to yaml bombs
78+
[[override]]
79+
name = "gopkg.in/yaml.v2"
80+
source = "https://github.com/simonferquel/yaml"
81+
revision="c86e64ed9581b7588e736f0c3e6ecc02cc22996e"
82+
7683
[[constraint]]
7784
name = "github.com/spf13/pflag"
7885
branch = "master"

cmd/docker-app/render.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import (
66

77
"github.com/docker/app/internal"
88
"github.com/docker/app/internal/packager"
9+
"github.com/docker/app/internal/yaml"
910
"github.com/docker/app/render"
1011
"github.com/docker/app/types"
1112
"github.com/docker/cli/cli"
1213
"github.com/docker/cli/cli/command"
1314
cliopts "github.com/docker/cli/opts"
1415
"github.com/spf13/cobra"
15-
"gopkg.in/yaml.v2"
1616
)
1717

1818
var (

e2e/render_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strings"
88
"testing"
99

10-
"gopkg.in/yaml.v2"
10+
"github.com/docker/app/internal/yaml"
1111
"gotest.tools/assert"
1212
)
1313

internal/helm/helm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/docker/app/internal/helm/templatev1beta2"
1616
"github.com/docker/app/internal/settings"
1717
"github.com/docker/app/internal/slices"
18+
"github.com/docker/app/internal/yaml"
1819
"github.com/docker/app/render"
1920
"github.com/docker/app/types"
2021
"github.com/docker/app/types/metadata"
@@ -23,7 +24,6 @@ import (
2324
"github.com/docker/cli/kubernetes/compose/v1beta1"
2425
"github.com/docker/cli/kubernetes/compose/v1beta2"
2526
"github.com/pkg/errors"
26-
yaml "gopkg.in/yaml.v2"
2727
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2828
)
2929

internal/inspect/inspect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
"text/tabwriter"
88

99
"github.com/docker/app/internal/settings"
10+
"github.com/docker/app/internal/yaml"
1011
"github.com/docker/app/types"
1112
"github.com/docker/app/types/metadata"
1213
"github.com/pkg/errors"
13-
yaml "gopkg.in/yaml.v2"
1414
)
1515

1616
// Inspect dumps the metadata of an app

internal/packager/fork.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99
"strings"
1010

1111
"github.com/docker/app/internal"
12+
"github.com/docker/app/internal/yaml"
1213
"github.com/docker/app/types/metadata"
1314
"github.com/pkg/errors"
1415
log "github.com/sirupsen/logrus"
15-
yaml "gopkg.in/yaml.v2"
1616
)
1717

1818
// Fork pulls an application and creates a local fork for the user to modify

internal/packager/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
"github.com/docker/app/internal"
1515
"github.com/docker/app/internal/compose"
16+
"github.com/docker/app/internal/yaml"
1617
"github.com/docker/app/loader"
1718
"github.com/docker/app/render"
1819
"github.com/docker/app/types"
@@ -22,7 +23,6 @@ import (
2223
"github.com/docker/cli/opts"
2324
"github.com/pkg/errors"
2425
log "github.com/sirupsen/logrus"
25-
"gopkg.in/yaml.v2"
2626
)
2727

2828
func prependToFile(filename, text string) error {

internal/packager/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
"strings"
1313

1414
"github.com/docker/app/internal"
15+
"github.com/docker/app/internal/yaml"
1516
"github.com/docker/app/types"
1617
"github.com/docker/app/types/metadata"
1718
"github.com/docker/distribution/reference"
1819
"github.com/pkg/errors"
19-
yaml "gopkg.in/yaml.v2"
2020
)
2121

2222
// Save saves an app to docker and returns the image name.

internal/renderer/yatee/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"strings"
77

88
"github.com/docker/app/internal/renderer"
9+
"github.com/docker/app/internal/yaml"
910
"github.com/docker/app/internal/yatee"
1011
"github.com/pkg/errors"
11-
yaml "gopkg.in/yaml.v2"
1212
)
1313

1414
func init() {

0 commit comments

Comments
 (0)