Skip to content

Commit 8eceb6e

Browse files
[AutoPR- Security] Patch strongswan for CVE-2025-62291 [HIGH] (#15526)
1 parent 13f8d1e commit 8eceb6e

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From b9cb54351a93eee3a6a69b13580efc416088e9f8 Mon Sep 17 00:00:00 2001
2+
From: Tobias Brunner <tobias@strongswan.org>
3+
Date: Thu, 9 Oct 2025 11:33:45 +0200
4+
Subject: [PATCH] eap-mschapv2: Fix length check for Failure Request packets on
5+
the client
6+
7+
For message lengths between 6 and 8, subtracting HEADER_LEN (9) causes
8+
`message_len` to become negative, which is then used in calls to malloc()
9+
and memcpy() that both take size_t arguments, causing an integer
10+
underflow.
11+
12+
For 6 and 7, the huge size requested from malloc() will fail (it exceeds
13+
PTRDIFF_MAX) and the returned NULL pointer will cause a segmentation
14+
fault in memcpy().
15+
16+
However, for 8, the allocation is 0, which succeeds. But then the -1
17+
passed to memcpy() causes a heap-based buffer overflow (and possibly a
18+
segmentation fault when attempting to read/write that much data).
19+
Fortunately, if compiled with -D_FORTIFY_SOURCE=3 (the default on e.g.
20+
Ubuntu), the compiler will use __memcpy_chk(), which prevents that buffer
21+
overflow and causes the daemon to get aborted immediately instead.
22+
23+
Fixes: f98cdf7a4765 ("adding plugin for EAP-MS-CHAPv2")
24+
Fixes: CVE-2025-62291
25+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
26+
Upstream-reference: https://download.strongswan.org/security/CVE-2025-62291/strongswan-4.4.0-6.0.2_eap_mschapv2_failure_request_len.patch
27+
---
28+
src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c | 2 +-
29+
1 file changed, 1 insertion(+), 1 deletion(-)
30+
31+
diff --git a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
32+
index 2e14bd9..1eedfeb 100644
33+
--- a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
34+
+++ b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
35+
@@ -972,7 +972,7 @@ static status_t process_peer_failure(private_eap_mschapv2_t *this,
36+
data = in->get_data(in);
37+
eap = (eap_mschapv2_header_t*)data.ptr;
38+
39+
- if (data.len < 3) /* we want at least an error code: E=e */
40+
+ if (data.len < HEADER_LEN + 3) /* we want at least an error code: E=e */
41+
{
42+
DBG1(DBG_IKE, "received invalid EAP-MS-CHAPv2 message: too short");
43+
return FAILED;
44+
--
45+
2.45.4
46+

SPECS/strongswan/strongswan.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: The OpenSource IPsec-based VPN Solution
22
Name: strongswan
33
Version: 5.9.10
4-
Release: 3%{?dist}
4+
Release: 4%{?dist}
55
License: GPLv2+
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -11,6 +11,7 @@ Source0: https://download.strongswan.org/%{name}-%{version}.tar.bz2
1111
Patch0: strongswan-fix-make-check.patch
1212
Patch1: 0001-Extending-timeout-for-test-cases-with-multiple-read-.patch
1313
Patch2: strongswan-5.9.7-5.9.11_charon_tkm_dh_len.patch
14+
Patch3: CVE-2025-62291.patch
1415
BuildRequires: autoconf
1516
BuildRequires: gmp-devel
1617

@@ -52,6 +53,9 @@ make check
5253
%{_datadir}/strongswan/*
5354

5455
%changelog
56+
* Mon Jan 19 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 5.9.10-4
57+
- Patch for CVE-2025-62291
58+
5559
* Wed Dec 13 2023 Elaine Zhao <@microsoft.com> - 5.9.10-3
5660
- Fix for CVE-2023-41913
5761

0 commit comments

Comments
 (0)