Skip to content

Commit 0c9474d

Browse files
authored
[MEDIUM] Patch cri-tools for CVE-2025-22872 (#13868)
1 parent b6f869e commit 0c9474d

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

SPECS/cri-tools/CVE-2025-22872.patch

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 25759747eeb4a11d5eca81632cc6a7245b14a99a Mon Sep 17 00:00:00 2001
2+
From: Aninda <[email protected]>
3+
Date: Wed, 21 May 2025 22:12:30 -0400
4+
Subject: [PATCH] Address CVE-2025-22872
5+
Upstream Patch Reference: https://github.com/golang/net/commit/e1fcd82abba34df74614020343be8eb1fe85f0d9
6+
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/cri-tools/cri-tools.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
Summary: CRI tools
88
Name: cri-tools
99
Version: 1.32.0
10-
Release: 1%{?dist}
10+
Release: 2%{?dist}
1111
License: Apache-2.0
1212
Vendor: Microsoft Corporation
1313
Distribution: Azure Linux
1414
Group: Development/Tools
1515
URL: https://github.com/kubernetes-sigs/cri-tools
1616
Source0: https://github.com/kubernetes-sigs/cri-tools/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
1717
Patch0: CVE-2024-45338.patch
18+
Patch1: CVE-2025-22872.patch
1819
BuildRequires: glib-devel
1920
BuildRequires: glibc-devel
2021
BuildRequires: golang
@@ -45,6 +46,9 @@ install -p -m 755 -t %{buildroot}%{_bindir} "${BUILD_FOLDER}/critest"
4546
%{_bindir}/critest
4647

4748
%changelog
49+
* Thu May 22 2025 Aninda Pradhan <[email protected]> - 1.32.0-2
50+
- Patch CVE-2025-22872
51+
4852
* Thu Jan 16 2025 CBL-Mariner Servicing Account <[email protected]> - 1.32.0-1
4953
- Auto-upgrade to 1.32.0 - to sync up with the latest AKS version
5054

0 commit comments

Comments
 (0)