Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update github.com/satori/go.uuid to address CVE-2021-3538 #90

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/sylabs/sif
go 1.13

require (
github.com/satori/go.uuid v1.2.0
github.com/satori/go.uuid v1.2.1-0.20180404165556-75cca531ea76
github.com/spf13/cobra v1.0.0
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/satori/go.uuid v1.2.1-0.20180404165556-75cca531ea76 h1:ofyVTM1w4iyKwaQIlRR6Ip06mXXx5Cnz7a4mTGYq1hE=
github.com/satori/go.uuid v1.2.1-0.20180404165556-75cca531ea76/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
Expand Down
9 changes: 7 additions & 2 deletions internal/app/siftool/modif.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@ import (

// New creates a new empty SIF file.
func New(file string) error {
id, err := uuid.NewV4()
if err != nil {
return fmt.Errorf("id generation failed: %v", err)
}

cinfo := sif.CreateInfo{
Pathname: file,
Launchstr: sif.HdrLaunch,
Sifversion: sif.HdrVersion,
ID: uuid.NewV4(),
ID: id,
}

_, err := sif.CreateContainer(cinfo)
_, err = sif.CreateContainer(cinfo)
if err != nil {
return err
}
Expand Down
9 changes: 7 additions & 2 deletions pkg/integrity/testdata/gen_sifs.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ import (
)

func createImage(path string, dis []sif.DescriptorInput) error {
id, err := uuid.NewV4()
if err != nil {
return fmt.Errorf("id generation failed: %v", err)
}

ci := sif.CreateInfo{
Pathname: path,
Launchstr: sif.HdrLaunch,
Sifversion: sif.HdrVersion,
ID: uuid.NewV4(),
ID: id,
InputDescr: dis,
}

_, err := sif.CreateContainer(ci)
_, err = sif.CreateContainer(ci)
return err
}

Expand Down
7 changes: 6 additions & 1 deletion pkg/sif/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,17 @@ func TestDataStructs(t *testing.T) {
}

func TestCreateContainer(t *testing.T) {
id, err := uuid.NewV4()
if err != nil {
t.Fatalf("id generation failed: %v", err)
}

// general info for the new SIF file creation
cinfo := CreateInfo{
Pathname: "testdata/testcontainer.sif",
Launchstr: HdrLaunch,
Sifversion: HdrVersion,
ID: uuid.NewV4(),
ID: id,
}

// test container creation without any input descriptors
Expand Down