Skip to content

Commit b4d8158

Browse files
[Medium] Patch multus for CVE-2025-22872 (#13596)
Co-authored-by: Bala <[email protected]>
1 parent 8f9b247 commit b4d8158

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

SPECS/multus/CVE-2025-22872.patch

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 56f9b57346900db55d5dad311a0efa7403338f2a Mon Sep 17 00:00:00 2001
2+
From: Kevin Lockwood <[email protected]>
3+
Date: Tue, 20 May 2025 16:13:03 -0700
4+
Subject: [PATCH] Patch CVE-2025-22872
5+
6+
Upstream 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 50f7c6a..cf52f26 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/multus/multus.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Summary: CNI plugin providing multiple interfaces in containers
2020
Name: multus
2121
Version: 4.0.2
22-
Release: 7%{?dist}
22+
Release: 8%{?dist}
2323
License: ASL 2.0
2424
Vendor: Microsoft Corporation
2525
Distribution: Mariner
@@ -30,6 +30,7 @@ Source0: https://github.com/k8snetworkplumbingwg/multus-cni/archive/refs/
3030
Patch0: CVE-2023-45288.patch
3131
Patch1: CVE-2023-3978.patch
3232
Patch2: CVE-2024-45338.patch
33+
Patch3: CVE-2025-22872.patch
3334
BuildRequires: golang
3435
BuildRequires: golang-packaging
3536

@@ -75,6 +76,9 @@ install -D -m0644 deployments/multus-daemonset.yml %{buildroot}%{_datadir}/k8s-y
7576
%{_datarootdir}/k8s-yaml/multus/multus.yaml
7677

7778
%changelog
79+
* Fri Apr 25 2025 Kevin Lockwood <[email protected]> - 4.0.2-8
80+
- Add patch for CVE-2025-22872
81+
7882
* Thu Jan 02 2025 Sumedh Sharma <[email protected]> - 4.0.2-7
7983
- Add patch for CVE-2024-45338.
8084

0 commit comments

Comments
 (0)