Skip to content

Commit a90267b

Browse files
CBL-Mariner-BotKanishk-Bansaljslobodzian
authored
[AUTO-CHERRYPICK] Patch coredns for CVE-2025-22868 [High] - branch 3.0-dev (#12816)
Co-authored-by: Kanishk Bansal <[email protected]> Co-authored-by: jslobodzian <[email protected]>
1 parent 6b90335 commit a90267b

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

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 <[email protected]>
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 <[email protected]>
14+
Reviewed-by: Damien Neil <[email protected]>
15+
Reviewed-by: Roland Shoemaker <[email protected]>
16+
LUCI-TryBot-Result: Go LUCI <[email protected]>
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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Summary: Fast and flexible DNS server
77
Name: coredns
88
Version: 1.11.4
9-
Release: 2%{?dist}
9+
Release: 3%{?dist}
1010
License: Apache License 2.0
1111
Vendor: Microsoft Corporation
1212
Distribution: Azure Linux
@@ -33,6 +33,7 @@ Source0: %{name}-%{version}.tar.gz
3333
# See: https://reproducible-builds.org/docs/archives/
3434
# - For the value of "--mtime" use the date "2021-04-26 00:00Z" to simplify future updates.
3535
Source1: %{name}-%{version}-vendor.tar.gz
36+
Patch0: CVE-2025-22868.patch
3637
# Patch to fix the package test suite due to external akamai update
3738
# https://github.com/coredns/coredns/commit/d8ecde1080e7cbbeb98257ba4e03a271f16b4cd9
3839
Patch1: coredns-example-net-test.patch
@@ -80,6 +81,9 @@ go install github.com/fatih/faillint@latest && \
8081
%{_bindir}/%{name}
8182

8283
%changelog
84+
* Mon Mar 03 2025 Kanishk Bansal <[email protected]> - 1.11.4-3
85+
- Fix CVE-2025-22868 with an upstream patch
86+
8387
* Mon Feb 10 2025 Sam Meluch <[email protected]> - 1.11.4-2
8488
- readd check section from 2.0
8589

0 commit comments

Comments
 (0)