Skip to content

Commit d75cb2c

Browse files
committed
chore(core): cve mitigation
Signed-off-by: Dmitry Lopatin <dmitry.lopatin@flant.com>
1 parent ae25ebf commit d75cb2c

5 files changed

Lines changed: 70 additions & 6 deletions

File tree

images/dvcr-artifact/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ replace (
195195

196196
// CVE Replaces
197197
replace (
198+
github.com/docker/docker => ./staging/src/github.com/docker/docker // CVE-2026-34040,CVE-2026-33997
198199
golang.org/x/crypto => golang.org/x/crypto v0.45.0 // CVE-2024-45337,CVE-2025-22869,CVE-2025-47914
199200
golang.org/x/net => golang.org/x/net v0.48.0
200201
golang.org/x/oauth2 => golang.org/x/oauth2 v0.34.0

images/dvcr-artifact/go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
3737
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
3838
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w=
3939
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI=
40-
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
41-
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
4240
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
4341
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
4442
github.com/containers/image/v5 v5.32.0 h1:yjbweazPfr8xOzQ2hkkYm1A2V0jN96/kES6Gwyxj7hQ=
@@ -66,14 +64,10 @@ github.com/docker/cli v29.2.0+incompatible h1:9oBd9+YM7rxjZLfyMGxjraKBKE4/nVyvVf
6664
github.com/docker/cli v29.2.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
6765
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
6866
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
69-
github.com/docker/docker v28.0.0+incompatible h1:Olh0KS820sJ7nPsBKChVhk5pzqcwDR15fumfAd/p9hM=
70-
github.com/docker/docker v28.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
7167
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
7268
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
7369
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
7470
github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=
75-
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
76-
github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw=
7771
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
7872
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
7973
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package versions
2+
3+
import (
4+
"strconv"
5+
"strings"
6+
)
7+
8+
// compare compares two version strings
9+
// returns -1 if v1 < v2, 1 if v1 > v2, 0 otherwise.
10+
func compare(v1, v2 string) int {
11+
if v1 == v2 {
12+
return 0
13+
}
14+
var (
15+
currTab = strings.Split(v1, ".")
16+
otherTab = strings.Split(v2, ".")
17+
)
18+
19+
maxVer := len(currTab)
20+
if len(otherTab) > maxVer {
21+
maxVer = len(otherTab)
22+
}
23+
for i := 0; i < maxVer; i++ {
24+
var currInt, otherInt int
25+
26+
if len(currTab) > i {
27+
currInt, _ = strconv.Atoi(currTab[i])
28+
}
29+
if len(otherTab) > i {
30+
otherInt, _ = strconv.Atoi(otherTab[i])
31+
}
32+
if currInt > otherInt {
33+
return 1
34+
}
35+
if otherInt > currInt {
36+
return -1
37+
}
38+
}
39+
return 0
40+
}
41+
42+
// LessThan checks if a version is less than another
43+
func LessThan(v, other string) bool {
44+
return compare(v, other) == -1
45+
}
46+
47+
// LessThanOrEqualTo checks if a version is less than or equal to another
48+
func LessThanOrEqualTo(v, other string) bool {
49+
return compare(v, other) <= 0
50+
}
51+
52+
// GreaterThan checks if a version is greater than another
53+
func GreaterThan(v, other string) bool {
54+
return compare(v, other) == 1
55+
}
56+
57+
// GreaterThanOrEqualTo checks if a version is greater than or equal to another
58+
func GreaterThanOrEqualTo(v, other string) bool {
59+
return compare(v, other) >= 0
60+
}
61+
62+
// Equal checks if a version is equal to another
63+
func Equal(v, other string) bool {
64+
return compare(v, other) == 0
65+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/docker/docker
2+
3+
go 1.24.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package registry

0 commit comments

Comments
 (0)