Skip to content

Commit 05e88db

Browse files
[Medium] Patch kube-vip-cloud-provider for CVE-2025-22872 (#13523)
1 parent 709e977 commit 05e88db

File tree

2 files changed

+66
-2
lines changed

2 files changed

+66
-2
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
From bbe4000b0322fd46086cf73856cbafff9823b421 Mon Sep 17 00:00:00 2001
2+
From: Roland Shoemaker <[email protected]>
3+
Date: Mon, 24 Feb 2025 11:18:31 -0800
4+
Subject: [PATCH] html: properly handle trailing solidus in unquoted attribute
5+
value in foreign content
6+
7+
The parser properly treats tags like <p a=/> as <p a="/">, but the
8+
tokenizer emits the SelfClosingTagToken token incorrectly. When the
9+
parser is used to parse foreign content, this results in an incorrect
10+
DOM.
11+
12+
Thanks to Sean Ng (https://ensy.zip) for reporting this issue.
13+
14+
Fixes golang/go#73070
15+
Fixes CVE-2025-22872
16+
17+
Change-Id: I65c18df6d6244bf943b61e6c7a87895929e78f4f
18+
Reviewed-on: https://go-review.googlesource.com/c/net/+/661256
19+
Reviewed-by: Neal Patel <[email protected]>
20+
Reviewed-by: Roland Shoemaker <[email protected]>
21+
LUCI-TryBot-Result: Go LUCI <[email protected]>
22+
Auto-Submit: Gopher Robot <[email protected]>
23+
Link: https://github.com/golang/net/commit/e1fcd82abba34df74614020343be8eb1fe85f0d9
24+
---
25+
vendor/golang.org/x/net/html/token.go | 18 ++++++++++++++++--
26+
1 file changed, 16 insertions(+), 2 deletions(-)
27+
28+
diff --git a/vendor/golang.org/x/net/html/token.go b/vendor/golang.org/x/net/html/token.go
29+
index 3c57880..6598c1f 100644
30+
--- a/vendor/golang.org/x/net/html/token.go
31+
+++ b/vendor/golang.org/x/net/html/token.go
32+
@@ -839,8 +839,22 @@ func (z *Tokenizer) readStartTag() TokenType {
33+
if raw {
34+
z.rawTag = strings.ToLower(string(z.buf[z.data.start:z.data.end]))
35+
}
36+
- // Look for a self-closing token like "<br/>".
37+
- if z.err == nil && z.buf[z.raw.end-2] == '/' {
38+
+ // Look for a self-closing token (e.g. <br/>).
39+
+ //
40+
+ // Originally, we did this by just checking that the last character of the
41+
+ // tag (ignoring the closing bracket) was a solidus (/) character, but this
42+
+ // is not always accurate.
43+
+ //
44+
+ // We need to be careful that we don't misinterpret a non-self-closing tag
45+
+ // as self-closing, as can happen if the tag contains unquoted attribute
46+
+ // values (i.e. <p a=/>).
47+
+ //
48+
+ // To avoid this, we check that the last non-bracket character of the tag
49+
+ // (z.raw.end-2) isn't the same character as the last non-quote character of
50+
+ // the last attribute of the tag (z.pendingAttr[1].end-1), if the tag has
51+
+ // attributes.
52+
+ nAttrs := len(z.attr)
53+
+ if z.err == nil && z.buf[z.raw.end-2] == '/' && (nAttrs == 0 || z.raw.end-2 != z.attr[nAttrs-1][1].end-1) {
54+
return SelfClosingTagToken
55+
}
56+
return StartTagToken
57+
--
58+
2.34.1
59+

SPECS/kube-vip-cloud-provider/kube-vip-cloud-provider.spec

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: The Kube-Vip cloud provider functions as a general-purpose cloud provider for on-premises bare-metal or virtualized setups
22
Name: kube-vip-cloud-provider
33
Version: 0.0.10
4-
Release: 3%{?dist}
4+
Release: 4%{?dist}
55
License: ASL 2.0
66
URL: https://github.com/kube-vip/kube-vip-cloud-provider
77
Group: Applications/Text
@@ -21,11 +21,13 @@ Source1: %{name}-%{version}-vendor.tar.gz
2121

2222
Patch1: CVE-2023-47108.patch
2323
Patch2: CVE-2024-45338.patch
24+
# CVE-2025-22872 is fixed in go net version .38.0 by https://github.com/golang/net/commit/e1fcd82abba34df74614020343be8eb1fe85f0d9
25+
Patch3: CVE-2025-22872.patch
2426

2527
BuildRequires: golang >= 1.22
2628

2729
%description
28-
The Kube-Vip cloud provider functions as a general-purpose cloud provider for on-premises bare-metal or virtualized setups.
30+
The Kube-Vip cloud provider functions as a general-purpose cloud provider for on-premises bare-metal or virtualized setups.
2931

3032
%prep
3133
%autosetup -a 1 -p1
@@ -41,6 +43,9 @@ install kube-vip-cloud-provider %{buildroot}%{_bindir}/kube-vip-cloud-provider
4143
%{_bindir}/kube-vip-cloud-provider
4244

4345
%changelog
46+
* Mon Apr 21 2025 Kevin Lockwood <[email protected]> - 0.0.10-4
47+
- Add patch for CVE-2025-22872
48+
4449
* Tue Dec 31 2024 Rohit Rawat <[email protected]> - 0.0.10-3
4550
- Add patch for CVE-2024-45338
4651

0 commit comments

Comments
 (0)