Skip to content

Commit cb33432

Browse files
azurelinux-securityKanishk-BansalAkarshHCL
authored
[AutoPR- Security] Patch openssh for CVE-2025-61985, CVE-2025-61984 [LOW] (microsoft#14827)
Co-authored-by: Kanishk Bansal <[email protected]> Co-authored-by: Akarsh Chaudhary <[email protected]>
1 parent f084528 commit cb33432

File tree

3 files changed

+87
-1
lines changed

3 files changed

+87
-1
lines changed

SPECS/openssh/CVE-2025-61984.patch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From c3f60955db44c675359e6fa512e16eb2f6fddd0b Mon Sep 17 00:00:00 2001
2+
From: AllSpark <[email protected]>
3+
Date: Tue, 7 Oct 2025 16:06:54 +0000
4+
Subject: [PATCH] Backport: Improve rules for %-expansion of username. Validate
5+
control chars in usernames, avoid percent expansion for command line or
6+
default users; expand only configuration-specified users without using %r/%C;
7+
update validation rules accordingly.
8+
9+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
10+
Upstream-reference: AI Backport of https://github.com/openssh/openssh-portable/commit/35d5917652106aede47621bb3f64044604164043.patch
11+
12+
---
13+
ssh.c | 2 ++
14+
1 file changed, 2 insertions(+)
15+
16+
diff --git a/ssh.c b/ssh.c
17+
index 0019281..182c7c3 100644
18+
--- a/ssh.c
19+
+++ b/ssh.c
20+
@@ -649,6 +649,8 @@ valid_ruser(const char *s)
21+
if (*s == '-')
22+
return 0;
23+
for (i = 0; s[i] != 0; i++) {
24+
+ if (iscntrl((u_char)s[i]))
25+
+ return 0;
26+
if (strchr("'`\";&<>|(){}", s[i]) != NULL)
27+
return 0;
28+
/* Disallow '-' after whitespace */
29+
--
30+
2.43.0
31+

SPECS/openssh/CVE-2025-61985.patch

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
From 8c0e088108a64862ca7ffe120d1b75a0dc9393d2 Mon Sep 17 00:00:00 2001
2+
From: AllSpark <[email protected]>
3+
Date: Tue, 7 Oct 2025 15:56:10 +0000
4+
Subject: [PATCH] misc: urldecode: don't allow NUL in url-encoded strings;
5+
avoid fatal on oversized input\n\nUpstream OpenBSD change: don't allow \0
6+
characters in url-encoded strings. Suggested by David Leadbeater, ok deraadt@
7+
8+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
9+
Upstream-reference: AI Backport of https://github.com/openssh/openssh-portable/commit/43b3bff47bb029f2299bacb6a36057981b39fdb0.patch
10+
---
11+
misc.c | 7 ++++---
12+
1 file changed, 4 insertions(+), 3 deletions(-)
13+
14+
diff --git a/misc.c b/misc.c
15+
index afdf514..275e280 100644
16+
--- a/misc.c
17+
+++ b/misc.c
18+
@@ -1,4 +1,4 @@
19+
-/* $OpenBSD: misc.c,v 1.196 2024/06/06 17:15:25 djm Exp $ */
20+
+/* $OpenBSD: misc.c,v 1.205 2025/09/04 00:30:06 djm Exp $ */
21+
/*
22+
* Copyright (c) 2000 Markus Friedl. All rights reserved.
23+
* Copyright (c) 2005-2020 Damien Miller. All rights reserved.
24+
@@ -969,7 +969,7 @@ urldecode(const char *src)
25+
size_t srclen;
26+
27+
if ((srclen = strlen(src)) >= SIZE_MAX)
28+
- fatal_f("input too large");
29+
+ return NULL;
30+
ret = xmalloc(srclen + 1);
31+
for (dst = ret; *src != '\0'; src++) {
32+
switch (*src) {
33+
@@ -977,9 +977,10 @@ urldecode(const char *src)
34+
*dst++ = ' ';
35+
break;
36+
case '%':
37+
+ /* note: don't allow \0 characters */
38+
if (!isxdigit((unsigned char)src[1]) ||
39+
!isxdigit((unsigned char)src[2]) ||
40+
- (ch = hexchar(src + 1)) == -1) {
41+
+ (ch = hexchar(src + 1)) == -1 || ch == 0) {
42+
free(ret);
43+
return NULL;
44+
}
45+
--
46+
2.45.4
47+

SPECS/openssh/openssh.spec

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Free version of the SSH connectivity tools
44
Name: openssh
55
Version: %{openssh_ver}
6-
Release: 4%{?dist}
6+
Release: 5%{?dist}
77
License: BSD
88
Vendor: Microsoft Corporation
99
Distribution: Azure Linux
@@ -36,10 +36,13 @@ Patch307: pam_ssh_agent_auth-0.10.2-dereference.patch
3636
#This CVE Patches both CVE-2025-26465 and CVE-2025-26466
3737
Patch400: CVE-2025-26465.patch
3838
Patch401: CVE-2025-32728.patch
39+
Patch402: CVE-2025-61984.patch
40+
Patch403: CVE-2025-61985.patch
3941
# sk-dummy.so built with -fvisibility=hidden does not work
4042
# The tests fail with the following error:
4143
# dlsym(sk_api_version) failed: (...)/sk-dummy.so: undefined symbol: sk_api_version
4244
Patch965: openssh-8.2p1-visibility.patch
45+
4346
BuildRequires: audit-devel
4447
BuildRequires: autoconf
4548
BuildRequires: e2fsprogs-devel
@@ -116,6 +119,8 @@ popd
116119
%patch -P 400 -p1 -b .CVE-2025-26465.patch
117120
%patch -P 401 -p1 -b .CVE-2025-32728.patch
118121
%patch -P 965 -p1 -b .visibility
122+
%patch -P 402 -p1 -b .CVE-2025-61984.patch
123+
%patch -P 403 -p1 -b .CVE-2025-61985.patch
119124

120125
%build
121126
# The -fvisibility=hidden is needed for clean build of the pam_ssh_agent_auth.
@@ -274,6 +279,9 @@ fi
274279
%{_mandir}/man8/ssh-sk-helper.8.gz
275280

276281
%changelog
282+
* Tue Oct 07 2025 Azure Linux Security Servicing Account <[email protected]> - 9.8p1-5
283+
- Patch CVE-2025-61985, CVE-2025-61984
284+
277285
* Thu Apr 17 2025 Sudipta Pandit <[email protected]> - 9.8p1-4
278286
- Patch CVE-2025-32728
279287

0 commit comments

Comments
 (0)