Skip to content

Commit 4809e87

Browse files
[AutoPR- Security] Patch cmake for CVE-2025-10148 [MEDIUM] (microsoft#14675)
1 parent f8db9bb commit 4809e87

File tree

4 files changed

+80
-5
lines changed

4 files changed

+80
-5
lines changed

SPECS/cmake/CVE-2025-10148.patch

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
From 314fdb876cae7b8b57932adbdab40cb8a9148cfc Mon Sep 17 00:00:00 2001
2+
From: AllSpark <[email protected]>
3+
Date: Sat, 13 Sep 2025 06:29:24 +0000
4+
Subject: [PATCH] ws: get a new mask for each new outgoing frame
5+
6+
- Move mask generation from accept to frame send: generate a fresh 4-byte
7+
random mask for every outgoing frame in ws_enc_write_head.
8+
- Allow forcing zero mask in DEBUGBUILD via CURL_WS_FORCE_ZERO_MASK env.
9+
- Remove mask generation and printing from Curl_ws_accept and update log
10+
message to not leak mask bytes.
11+
12+
Reported-by: Calvin Ruocco
13+
Closes: #18496
14+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
15+
Upstream-reference: AI Backport of https://github.com/curl/curl/commit/84db7a9eae8468c0445b15aa806fa.patch
16+
---
17+
Utilities/cmcurl/lib/ws.c | 24 ++++++++++++++++--------
18+
1 file changed, 16 insertions(+), 8 deletions(-)
19+
20+
diff --git a/Utilities/cmcurl/lib/ws.c b/Utilities/cmcurl/lib/ws.c
21+
index 6ccf9e65..476b7ad9 100644
22+
--- a/Utilities/cmcurl/lib/ws.c
23+
+++ b/Utilities/cmcurl/lib/ws.c
24+
@@ -544,6 +544,7 @@ static ssize_t ws_enc_write_head(struct Curl_easy *data,
25+
unsigned char head[14];
26+
size_t hlen;
27+
ssize_t n;
28+
+ CURLcode result;
29+
30+
if(payload_len < 0) {
31+
failf(data, "WS: starting new frame with negative payload length %"
32+
@@ -615,6 +616,20 @@ static ssize_t ws_enc_write_head(struct Curl_easy *data,
33+
enc->payload_remain = enc->payload_len = payload_len;
34+
ws_enc_info(enc, data, "sending");
35+
36+
+ /* 4 bytes random */
37+
+
38+
+ result = Curl_rand(data, (unsigned char *)&enc->mask, sizeof(enc->mask));
39+
+ if(result) {
40+
+ *err = result;
41+
+ return -1;
42+
+ }
43+
+
44+
+#ifdef DEBUGBUILD
45+
+ if(getenv("CURL_WS_FORCE_ZERO_MASK"))
46+
+ /* force the bit mask to 0x00000000, effectively disabling masking */
47+
+ memset(&enc->mask, 0, sizeof(enc->mask));
48+
+#endif
49+
+
50+
/* add 4 bytes mask */
51+
memcpy(&head[hlen], &enc->mask, 4);
52+
hlen += 4;
53+
@@ -805,14 +820,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data,
54+
subprotocol not requested by the client), the client MUST Fail
55+
the WebSocket Connection. */
56+
57+
- /* 4 bytes random */
58+
-
59+
- result = Curl_rand(data, (unsigned char *)&ws->enc.mask,
60+
- sizeof(ws->enc.mask));
61+
- if(result)
62+
- return result;
63+
- infof(data, "Received 101, switch to WebSocket; mask %02x%02x%02x%02x",
64+
- ws->enc.mask[0], ws->enc.mask[1], ws->enc.mask[2], ws->enc.mask[3]);
65+
+ infof(data, "[WS] Received 101, switch to WebSocket");
66+
67+
/* Install our client writer that decodes WS frames payload */
68+
result = Curl_cwriter_create(&ws_dec_writer, data, &ws_cw_decode,
69+
--
70+
2.45.4
71+

SPECS/cmake/cmake.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Summary: Cmake
33
Name: cmake
44
Version: 3.30.3
5-
Release: 9%{?dist}
5+
Release: 10%{?dist}
66
License: BSD AND LGPLv2+
77
Vendor: Microsoft Corporation
88
Distribution: Azure Linux
@@ -31,6 +31,7 @@ Patch11: CVE-2025-5916.patch
3131
Patch12: CVE-2025-5917.patch
3232
Patch13: CVE-2025-5918.patch
3333
Patch14: CVE-2025-9301.patch
34+
Patch15: CVE-2025-10148.patch
3435

3536
BuildRequires: bzip2
3637
BuildRequires: bzip2-devel
@@ -111,6 +112,9 @@ bin/ctest --force-new-ctest-process --rerun-failed --output-on-failure
111112
%{_libdir}/rpm/macros.d/macros.cmake
112113

113114
%changelog
115+
* Sat Sep 13 2025 Azure Linux Security Servicing Account <[email protected]> - 3.30.3-10
116+
- Patch for CVE-2025-10148
117+
114118
* Fri Aug 22 2025 Azure Linux Security Servicing Account <[email protected]> - 3.30.3-9
115119
- Patch for CVE-2025-9301
116120

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ check-debuginfo-0.15.2-1.azl3.aarch64.rpm
5151
chkconfig-1.25-1.azl3.aarch64.rpm
5252
chkconfig-debuginfo-1.25-1.azl3.aarch64.rpm
5353
chkconfig-lang-1.25-1.azl3.aarch64.rpm
54-
cmake-3.30.3-9.azl3.aarch64.rpm
55-
cmake-debuginfo-3.30.3-9.azl3.aarch64.rpm
54+
cmake-3.30.3-10.azl3.aarch64.rpm
55+
cmake-debuginfo-3.30.3-10.azl3.aarch64.rpm
5656
coreutils-9.4-6.azl3.aarch64.rpm
5757
coreutils-debuginfo-9.4-6.azl3.aarch64.rpm
5858
coreutils-lang-9.4-6.azl3.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ check-debuginfo-0.15.2-1.azl3.x86_64.rpm
5454
chkconfig-1.25-1.azl3.x86_64.rpm
5555
chkconfig-debuginfo-1.25-1.azl3.x86_64.rpm
5656
chkconfig-lang-1.25-1.azl3.x86_64.rpm
57-
cmake-3.30.3-9.azl3.x86_64.rpm
58-
cmake-debuginfo-3.30.3-9.azl3.x86_64.rpm
57+
cmake-3.30.3-10.azl3.x86_64.rpm
58+
cmake-debuginfo-3.30.3-10.azl3.x86_64.rpm
5959
coreutils-9.4-6.azl3.x86_64.rpm
6060
coreutils-debuginfo-9.4-6.azl3.x86_64.rpm
6161
coreutils-lang-9.4-6.azl3.x86_64.rpm

0 commit comments

Comments
 (0)