Skip to content

Commit 75d9abe

Browse files
CBL-Mariner-BotKanishk-Bansaljslobodzian
authored
[AUTO-CHERRYPICK] Patch coredns for CVE-2025-22868 [High] - branch main (#12736)
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com> Co-authored-by: jslobodzian <joslobo@microsoft.com>
1 parent 327db28 commit 75d9abe

2 files changed

Lines changed: 46 additions & 4 deletions

File tree

SPECS/coredns/CVE-2025-22868.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From 681b4d8edca1bcfea5bce685d77ea7b82ed3e7b3 Mon Sep 17 00:00:00 2001
2+
From: Neal Patel <nealpatel@google.com>
3+
Date: Thu, 30 Jan 2025 14:10:09 -0500
4+
Subject: [PATCH] jws: split token into fixed number of parts
5+
6+
Thanks to 'jub0bs' for reporting this issue.
7+
8+
Fixes #71490
9+
Fixes CVE-2025-22868
10+
11+
Change-Id: I2552731f46d4907f29aafe7863c558387b6bd6e2
12+
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/652155
13+
Auto-Submit: Gopher Robot <gobot@golang.org>
14+
Reviewed-by: Damien Neil <dneil@google.com>
15+
Reviewed-by: Roland Shoemaker <roland@golang.org>
16+
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
17+
---
18+
vendor/golang.org/x/oauth2/jws/jws.go | 4 ++--
19+
1 file changed, 2 insertions(+), 2 deletions(-)
20+
21+
diff --git a/vendor/golang.org/x/oauth2/jws/jws.go b/vendor/golang.org/x/oauth2/jws/jws.go
22+
index 95015648b..6f03a49d3 100644
23+
--- a/vendor/golang.org/x/oauth2/jws/jws.go
24+
+++ b/vendor/golang.org/x/oauth2/jws/jws.go
25+
@@ -165,11 +165,11 @@ func Encode(header *Header, c *ClaimSet, key *rsa.PrivateKey) (string, error) {
26+
// Verify tests whether the provided JWT token's signature was produced by the private key
27+
// associated with the supplied public key.
28+
func Verify(token string, key *rsa.PublicKey) error {
29+
- parts := strings.Split(token, ".")
30+
- if len(parts) != 3 {
31+
+ if strings.Count(token, ".") != 2 {
32+
return errors.New("jws: invalid token received, token must have 3 parts")
33+
}
34+
35+
+ parts := strings.SplitN(token, ".", 3)
36+
signedContent := parts[0] + "." + parts[1]
37+
signatureString, err := base64.RawURLEncoding.DecodeString(parts[2])
38+
if err != nil {

SPECS/coredns/coredns.spec

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Fast and flexible DNS server
44
Name: coredns
55
Version: 1.11.1
6-
Release: 13%{?dist}
6+
Release: 14%{?dist}
77
License: Apache License 2.0
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
@@ -37,11 +37,12 @@ Patch3: CVE-2024-22189.patch
3737
Patch4: CVE-2023-45288.patch
3838
Patch5: CVE-2024-0874.patch
3939
Patch6: CVE-2024-24786.patch
40+
Patch7: CVE-2025-22868.patch
4041
# Patch to fix the package test suite due to external akamai update
4142
# https://github.com/coredns/coredns/commit/d8ecde1080e7cbbeb98257ba4e03a271f16b4cd9
42-
Patch7: coredns-example-net-test.patch
43+
Patch8: coredns-example-net-test.patch
4344

44-
BuildRequires: golang
45+
BuildRequires: msft-golang
4546

4647
%description
4748
CoreDNS is a fast and flexible DNS server.
@@ -78,9 +79,12 @@ install -p -m 755 -t %{buildroot}%{_bindir} %{name}
7879
%{_bindir}/%{name}
7980

8081
%changelog
81-
* Mon Feb 10 2025 Sam Meluch <sammeluch@microsoft.com> - 1.11.1-13
82+
* Mon Mar 03 2025 Sam Meluch <sammeluch@microsoft.com> - 1.11.1-14
8283
- Fix package test with upstream patch
8384

85+
* Mon Mar 03 2025 Kanishk Bansal <kanbansal@microsoft.com> - 1.11.1-13
86+
- Fix CVE-2025-22868 with an upstream patch
87+
8488
* Mon Dec 09 2024 Kavya Sree Kaitepalli <kkaitepalli@microsoft.com> - 1.11.1-12
8589
- Patch for CVE-2024-24786
8690

0 commit comments

Comments
 (0)