Skip to content

[MEDIUM] Patch cri-tools for CVE-2025-22872 #13868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions SPECS/cri-tools/CVE-2025-22872.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 25759747eeb4a11d5eca81632cc6a7245b14a99a Mon Sep 17 00:00:00 2001
From: Aninda <[email protected]>
Date: Wed, 21 May 2025 22:12:30 -0400
Subject: [PATCH] Address CVE-2025-22872
Upstream Patch Reference: https://github.com/golang/net/commit/e1fcd82abba34df74614020343be8eb1fe85f0d9

---
vendor/golang.org/x/net/html/token.go | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/vendor/golang.org/x/net/html/token.go b/vendor/golang.org/x/net/html/token.go
index 3c57880..6598c1f 100644
--- a/vendor/golang.org/x/net/html/token.go
+++ b/vendor/golang.org/x/net/html/token.go
@@ -839,8 +839,22 @@ func (z *Tokenizer) readStartTag() TokenType {
if raw {
z.rawTag = strings.ToLower(string(z.buf[z.data.start:z.data.end]))
}
- // Look for a self-closing token like "<br/>".
- if z.err == nil && z.buf[z.raw.end-2] == '/' {
+ // Look for a self-closing token (e.g. <br/>).
+ //
+ // Originally, we did this by just checking that the last character of the
+ // tag (ignoring the closing bracket) was a solidus (/) character, but this
+ // is not always accurate.
+ //
+ // We need to be careful that we don't misinterpret a non-self-closing tag
+ // as self-closing, as can happen if the tag contains unquoted attribute
+ // values (i.e. <p a=/>).
+ //
+ // To avoid this, we check that the last non-bracket character of the tag
+ // (z.raw.end-2) isn't the same character as the last non-quote character of
+ // the last attribute of the tag (z.pendingAttr[1].end-1), if the tag has
+ // attributes.
+ nAttrs := len(z.attr)
+ if z.err == nil && z.buf[z.raw.end-2] == '/' && (nAttrs == 0 || z.raw.end-2 != z.attr[nAttrs-1][1].end-1) {
return SelfClosingTagToken
}
return StartTagToken
--
2.34.1

6 changes: 5 additions & 1 deletion SPECS/cri-tools/cri-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
Summary: CRI tools
Name: cri-tools
Version: 1.32.0
Release: 1%{?dist}
Release: 2%{?dist}
License: Apache-2.0
Vendor: Microsoft Corporation
Distribution: Azure Linux
Group: Development/Tools
URL: https://github.com/kubernetes-sigs/cri-tools
Source0: https://github.com/kubernetes-sigs/cri-tools/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: CVE-2024-45338.patch
Patch1: CVE-2025-22872.patch
BuildRequires: glib-devel
BuildRequires: glibc-devel
BuildRequires: golang
Expand Down Expand Up @@ -45,6 +46,9 @@ install -p -m 755 -t %{buildroot}%{_bindir} "${BUILD_FOLDER}/critest"
%{_bindir}/critest

%changelog
* Thu May 22 2025 Aninda Pradhan <[email protected]> - 1.32.0-2
- Patch CVE-2025-22872

* Thu Jan 16 2025 CBL-Mariner Servicing Account <[email protected]> - 1.32.0-1
- Auto-upgrade to 1.32.0 - to sync up with the latest AKS version

Expand Down
Loading