Skip to content

Commit 2bb5064

Browse files
Merge PR "[AUTO-CHERRYPICK] [AutoPR- Security] Patch strongswan for CVE-2025-62291 [HIGH] - branch 3.0-dev" #15541
Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
1 parent 56841b5 commit 2bb5064

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 ae75a582a276ca4b1f6b9b68fe602f41a6e93109 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 1bb54c8..9ad509a 100644
33+
--- a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
34+
+++ b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c
35+
@@ -974,7 +974,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
@@ -12,7 +12,7 @@
1212

1313
Name: strongswan
1414
Version: 5.9.14
15-
Release: 7%{?dist}
15+
Release: 8%{?dist}
1616
Summary: An OpenSource IPsec-based VPN and TNC solution
1717
# Automatically converted from old format: GPLv2+ - review is highly recommended.
1818
License: GPL-2.0-or-later
@@ -31,6 +31,7 @@ Patch2: strongswan-6.0.0-gcc15.patch
3131
Patch3: strongswan-6.0.1-gcc15.patch
3232
Patch4: strongswan-fix-make-check.patch
3333
Patch5: 0001-Extending-timeout-for-test-cases-with-multiple-read-.patch
34+
Patch6: CVE-2025-62291.patch
3435

3536
BuildRequires: autoconf
3637
BuildRequires: automake
@@ -425,6 +426,9 @@ install -D -m 0644 %{SOURCE3} %{buildroot}/%{_tmpfilesdir}/strongswan-starter.co
425426
%endif
426427

427428
%changelog
429+
* Mon Jan 19 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 5.9.14-8
430+
- Patch for CVE-2025-62291
431+
428432
* Fri May 23 2025 Mayank Singh <mayansingh@microsoft.com> - 5.9.14-7
429433
- Initial Azure Linux import from Fedora 42 (license: MIT).
430434
- License verified

0 commit comments

Comments
 (0)