Skip to content

Commit dc98a22

Browse files
[AutoPR- Security] Patch openssh for CVE-2025-61985 [MEDIUM] (microsoft#14847)
Co-authored-by: Kanishk Bansal <[email protected]>
1 parent d5a9689 commit dc98a22

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

SPECS/openssh/CVE-2025-61985.patch

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

SPECS/openssh/openssh.spec

Lines changed: 6 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: 8%{?dist}
6+
Release: 9%{?dist}
77
License: BSD
88
Vendor: Microsoft Corporation
99
Distribution: Mariner
@@ -50,6 +50,7 @@ Patch350: CVE-2023-28531.patch
5050
Patch351: CVE-2024-6387.patch
5151
Patch352: CVE-2025-26465.patch
5252
Patch353: CVE-2025-32728.patch
53+
Patch354: CVE-2025-61985.patch
5354
BuildRequires: audit-devel
5455
BuildRequires: autoconf
5556
BuildRequires: e2fsprogs-devel
@@ -138,6 +139,7 @@ popd
138139
%patch351 -p1 -b .cve-2024-6387
139140
%patch352 -p1 -b .cve-2025-26465
140141
%patch353 -p1 -b .cve-2025-32728
142+
%patch354 -p1 -b .CVE-2025-61985
141143

142144
%build
143145
export CFLAGS="$CFLAGS -fpic"
@@ -294,6 +296,9 @@ fi
294296
%{_mandir}/man8/ssh-sk-helper.8.gz
295297

296298
%changelog
299+
* Thu Oct 09 2025 Azure Linux Security Servicing Account <[email protected]> - 8.9p1-9
300+
- Patch CVE-2025-61985
301+
297302
* Fri Apr 18 2025 Sudipta Pandit <[email protected]> - 8.9p1-8
298303
- Patch CVE-2025-32728
299304

0 commit comments

Comments
 (0)