Skip to content

Commit 496c5d0

Browse files
authored
[Medium] patch docker-compose for CVE-2025-22872 (#13557)
1 parent c53bd1c commit 496c5d0

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 01035da6c5be2080f75765d9ebbb462614d7e81a Mon Sep 17 00:00:00 2001
2+
From: jykanase <[email protected]>
3+
Date: Tue, 22 Apr 2025 08:15:38 +0000
4+
Subject: [PATCH] CVE-2025-22872
5+
6+
Upstream patch reference: https://github.com/golang/net/commit/e1fcd82abba34df74614020343be8eb1fe85f0d9
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.45.2
42+

SPECS/docker-compose/docker-compose.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Define and run multi-container applications with Docker
22
Name: docker-compose
33
Version: 2.27.0
4-
Release: 4%{?dist}
4+
Release: 5%{?dist}
55
License: ASL 2.0
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -16,6 +16,7 @@ Patch0: CVE-2024-45337.patch
1616
Patch1: CVE-2024-45338.patch
1717
Patch2: CVE-2025-22869.patch
1818
Patch3: CVE-2024-10846.patch
19+
Patch4: CVE-2025-22872.patch
1920
BuildRequires: golang
2021
Requires: docker-cli
2122
Obsoletes: moby-compose < %{version}-%{release}
@@ -48,6 +49,9 @@ install -D -m0755 bin/build/docker-compose %{buildroot}/%{_libexecdir}/docker/cl
4849
%{_libexecdir}/docker/cli-plugins/docker-compose
4950

5051
%changelog
52+
* Wed Apr 23 2025 Jyoti Kanase <[email protected]> - 2.27.0-5
53+
- Patch CVE-2025-22872
54+
5155
* Mon Mar 03 2025 Kanishk Bansal <[email protected]> - 2.27.0-4
5256
- Fix CVE-2025-22869, CVE-2024-10846 with an upstream patch
5357

0 commit comments

Comments
 (0)