Skip to content

Commit 72d39bb

Browse files
[Medium] Patch vitess for CVE-2025-22872 (#13614)
1 parent 4188fb9 commit 72d39bb

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

SPECS/vitess/CVE-2025-22872.patch

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 8a2ee9d764b649c4ab4917daac4a9696e85414bb Mon Sep 17 00:00:00 2001
2+
From: Kevin Lockwood <[email protected]>
3+
Date: Thu, 8 May 2025 13:35:38 -0700
4+
Subject: [PATCH] Patch CVE-2025-22872
5+
6+
Upstream Patch Reference: https://github.com/golang/net/commit/e1fcd82abba34df74614020343be8eb1fe85f0d9.patch
7+
---
8+
vendor/golang.org/x/net/html/token.go | 18 ++++++++++++++++--
9+
1 file changed, 16 insertions(+), 2 deletions(-)
10+
11+
diff --git a/vendor/golang.org/x/net/html/token.go b/vendor/golang.org/x/net/html/token.go
12+
index 3c57880..6598c1f 100644
13+
--- a/vendor/golang.org/x/net/html/token.go
14+
+++ b/vendor/golang.org/x/net/html/token.go
15+
@@ -839,8 +839,22 @@ func (z *Tokenizer) readStartTag() TokenType {
16+
if raw {
17+
z.rawTag = strings.ToLower(string(z.buf[z.data.start:z.data.end]))
18+
}
19+
- // Look for a self-closing token like "<br/>".
20+
- if z.err == nil && z.buf[z.raw.end-2] == '/' {
21+
+ // Look for a self-closing token (e.g. <br/>).
22+
+ //
23+
+ // Originally, we did this by just checking that the last character of the
24+
+ // tag (ignoring the closing bracket) was a solidus (/) character, but this
25+
+ // is not always accurate.
26+
+ //
27+
+ // We need to be careful that we don't misinterpret a non-self-closing tag
28+
+ // as self-closing, as can happen if the tag contains unquoted attribute
29+
+ // values (i.e. <p a=/>).
30+
+ //
31+
+ // To avoid this, we check that the last non-bracket character of the tag
32+
+ // (z.raw.end-2) isn't the same character as the last non-quote character of
33+
+ // the last attribute of the tag (z.pendingAttr[1].end-1), if the tag has
34+
+ // attributes.
35+
+ nAttrs := len(z.attr)
36+
+ if z.err == nil && z.buf[z.raw.end-2] == '/' && (nAttrs == 0 || z.raw.end-2 != z.attr[nAttrs-1][1].end-1) {
37+
return SelfClosingTagToken
38+
}
39+
return StartTagToken
40+
--
41+
2.34.1
42+

SPECS/vitess/vitess.spec

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Name: vitess
55
Version: 17.0.7
6-
Release: 7%{?dist}
6+
Release: 8%{?dist}
77
Summary: Database clustering system for horizontal scaling of MySQL
88
# Upstream license specification: MIT and Apache-2.0
99
License: MIT and ASL 2.0
@@ -31,6 +31,8 @@ Patch1: CVE-2024-45339.patch
3131
Patch2: CVE-2025-22868.patch
3232
Patch3: CVE-2024-53257.patch
3333
Patch4: CVE-2025-22870.patch
34+
# CVE-2025-22872 is fixed in go net v0.38 by https://github.com/golang/net/commit/e1fcd82abba34df74614020343be8eb1fe85f0d9
35+
Patch5: CVE-2025-22872.patch
3436
BuildRequires: golang
3537

3638
%description
@@ -44,10 +46,7 @@ with an atomic cutover step that takes only a few seconds.
4446

4547

4648
%prep
47-
%autosetup -N
48-
# Apply vendor before patching
49-
tar --no-same-owner -xf %{SOURCE1}
50-
%autopatch -p1
49+
%autosetup -p1 -a1
5150

5251
# sed in Mariner does not work on a group of files; use for-loop to apply
5352
# to apply to individual file
@@ -103,6 +102,9 @@ go test -v ./go/cmd/... \
103102
%{_bindir}/*
104103

105104
%changelog
105+
* Fri Apr 25 2025 Kevin Lockwood <[email protected]> - 17.0.7-8
106+
- Add patch for CVE-2025-22872
107+
106108
* Thu Mar 20 2025 Sreeniavsulu Malavathula <[email protected]> - 17.0.7-7
107109
- Fix CVE-2024-51744 with an upstream patch
108110

0 commit comments

Comments
 (0)