Skip to content

Commit 6862bc2

Browse files
Merge PR "[AUTO-CHERRYPICK] [HIGH] Patch packer for CVE-2025-47913 - branch 3.0-dev" microsoft#15126
Co-authored-by: Archana Shettigar <[email protected]>
1 parent 1584edf commit 6862bc2

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

SPECS/packer/CVE-2025-47913.patch

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
From 559e062ce8bfd6a39925294620b50906ca2a6f95 Mon Sep 17 00:00:00 2001
2+
From: Nicola Murino <[email protected]>
3+
Date: Sun, 31 Aug 2025 20:07:32 +0200
4+
Subject: [PATCH] ssh/agent: return an error for unexpected message types
5+
6+
Previously, receiving an unexpected message type in response to a key
7+
listing or a signing request could cause a panic due to a failed type
8+
assertion.
9+
10+
This change adds a default case to the type switch in order to detect
11+
and explicitly handle unknown or invalid message types, returning a
12+
descriptive error instead of crashing.
13+
14+
Fixes golang/go#75178
15+
16+
Change-Id: Icbc3432adc79fe3c56b1ff23c6724d7a6f710f3a
17+
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/700295
18+
Reviewed-by: Roland Shoemaker <[email protected]>
19+
LUCI-TryBot-Result: Go LUCI <[email protected]>
20+
Reviewed-by: Michael Pratt <[email protected]>
21+
Reviewed-by: Jakub Ciolek <[email protected]>
22+
Upstream patch Reference: https://github.com/golang/crypto/commit/559e062ce8bfd6a39925294620b50906ca2a6f95.patch
23+
---
24+
vendor/golang.org/x/crypto/ssh/agent/client.go | 6 ++++--
25+
1 file changed, 4 insertions(+), 2 deletions(-)
26+
27+
diff --git a/vendor/golang.org/x/crypto/ssh/agent/client.go b/vendor/golang.org/x/crypto/ssh/agent/client.go
28+
index 106708d..31bd7e8 100644
29+
--- a/vendor/golang.org/x/crypto/ssh/agent/client.go
30+
+++ b/vendor/golang.org/x/crypto/ssh/agent/client.go
31+
@@ -430,8 +430,9 @@ func (c *client) List() ([]*Key, error) {
32+
return keys, nil
33+
case *failureAgentMsg:
34+
return nil, errors.New("agent: failed to list keys")
35+
+ default:
36+
+ return nil, fmt.Errorf("agent: failed to list keys, unexpected message type %T", msg)
37+
}
38+
- panic("unreachable")
39+
}
40+
41+
// Sign has the agent sign the data using a protocol 2 key as defined
42+
@@ -462,8 +463,9 @@ func (c *client) SignWithFlags(key ssh.PublicKey, data []byte, flags SignatureFl
43+
return &sig, nil
44+
case *failureAgentMsg:
45+
return nil, errors.New("agent: failed to sign challenge")
46+
+ default:
47+
+ return nil, fmt.Errorf("agent: failed to list keys, unexpected message type %T", msg)
48+
}
49+
- panic("unreachable")
50+
}
51+
52+
// unmarshal parses an agent message in packet, returning the parsed
53+
--
54+
2.45.4
55+

SPECS/packer/packer.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Summary: Tool for creating identical machine images for multiple platforms from a single source configuration.
55
Name: packer
66
Version: 1.9.5
7-
Release: 10%{?dist}
7+
Release: 11%{?dist}
88
License: MPLv2.0
99
Vendor: Microsoft Corporation
1010
Distribution: Azure Linux
@@ -44,6 +44,7 @@ Patch9: CVE-2025-22870.patch
4444
Patch10: CVE-2024-51744.patch
4545
Patch11: CVE-2025-22872.patch
4646
Patch12: CVE-2025-58058.patch
47+
Patch13: CVE-2025-47913.patch
4748

4849
BuildRequires: golang >= 1.21
4950
BuildRequires: kernel-headers
@@ -75,6 +76,9 @@ go test -mod=vendor
7576
%{_bindir}/packer
7677

7778
%changelog
79+
* Tue Nov 18 2025 Archana Shettigar <[email protected]> - 1.9.5-11
80+
- Patch CVE-2025-47913
81+
7882
* Wed Sep 03 2025 Azure Linux Security Servicing Account <[email protected]> - 1.9.5-10
7983
- Patch for CVE-2025-58058
8084

0 commit comments

Comments
 (0)