Skip to content

Commit 5d866b6

Browse files
authored
CVE Fix for x-crypto component in caddy. (#696)
- Applied suggested patch from NVD database for - CVE-2025-47913 - CVE-2025-47914 Signed-off-by: Shalini Singhal <shalinix.singhal@intel.com>
1 parent b00c157 commit 5d866b6

File tree

3 files changed

+94
-1
lines changed

3 files changed

+94
-1
lines changed

SPECS/caddy/CVE-2025-47913.patch

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From 559e062ce8bfd6a39925294620b50906ca2a6f95 Mon Sep 17 00:00:00 2001
2+
From: Nicola Murino <nicola.murino@gmail.com>
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 <roland@golang.org>
19+
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
20+
Reviewed-by: Michael Pratt <mpratt@google.com>
21+
Reviewed-by: Jakub Ciolek <jakub@ciolek.dev>
22+
---
23+
vendor/golang.org/x/crypto/ssh/agent/client.go | 6 +++--
24+
1 file changed, 6 insertions(+), 2 deletions(-)
25+
26+
diff --git a/vendor/golang.org/x/crypto/ssh/agent/client.go b/vendor/golang.org/x/crypto/ssh/agent/client.go
27+
index 37525e1a18..b357e18b0a 100644
28+
--- a/vendor/golang.org/x/crypto/ssh/agent/client.go
29+
+++ b/vendor/golang.org/x/crypto/ssh/agent/client.go
30+
@@ -430,8 +430,9 @@ func (c *client) List() ([]*Key, error) {
31+
return keys, nil
32+
case *failureAgentMsg:
33+
return nil, errors.New("agent: failed to list keys")
34+
+ default:
35+
+ return nil, fmt.Errorf("agent: failed to list keys, unexpected message type %T", msg)
36+
}
37+
- panic("unreachable")
38+
}
39+
40+
// Sign has the agent sign the data using a protocol 2 key as defined
41+
@@ -462,8 +463,9 @@ func (c *client) SignWithFlags(key ssh.PublicKey, data []byte, flags SignatureFl
42+
return &sig, nil
43+
case *failureAgentMsg:
44+
return nil, errors.New("agent: failed to sign challenge")
45+
+ default:
46+
+ return nil, fmt.Errorf("agent: failed to sign challenge, unexpected message type %T", msg)
47+
}
48+
- panic("unreachable")
49+
}
50+
51+
// unmarshal parses an agent message in packet, returning the parsed

SPECS/caddy/CVE-2025-47914.patch

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From f91f7a7c31bf90b39c1de895ad116a2bacc88748 Mon Sep 17 00:00:00 2001
2+
From: Neal Patel <nealpatel@google.com>
3+
Date: Wed, 10 Sep 2025 14:27:42 -0400
4+
Subject: [PATCH] ssh/agent: prevent panic on malformed constraint
5+
6+
An attacker could supply a malformed Constraint that
7+
would trigger a panic in a serving agent, effectively
8+
causing denial of service.
9+
10+
Thank you to Jakub Ciolek for reporting this issue.
11+
12+
Fixes CVE-2025-47914
13+
Fixes golang/go#76364
14+
15+
Change-Id: I195bbc68b1560d4f04897722a6a653a7cbf086eb
16+
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/721960
17+
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
18+
Auto-Submit: Roland Shoemaker <roland@golang.org>
19+
Reviewed-by: Damien Neil <dneil@google.com>
20+
---
21+
vendor/golang.org/x/crypto/ssh/agent/server.go | 3 +++
22+
1 file changed, 3 insertions(+)
23+
24+
diff --git a/vendor/golang.org/x/crypto/ssh/agent/server.go b/vendor/golang.org/x/crypto/ssh/agent/server.go
25+
index 88ce4da6c4..4e8ff86b61 100644
26+
--- a/vendor/golang.org/x/crypto/ssh/agent/server.go
27+
+++ b/vendor/golang.org/x/crypto/ssh/agent/server.go
28+
@@ -203,6 +203,9 @@ func parseConstraints(constraints []byte) (lifetimeSecs uint32, confirmBeforeUse
29+
for len(constraints) != 0 {
30+
switch constraints[0] {
31+
case agentConstrainLifetime:
32+
+ if len(constraints) < 5 {
33+
+ return 0, false, nil, io.ErrUnexpectedEOF
34+
+ }
35+
lifetimeSecs = binary.BigEndian.Uint32(constraints[1:5])
36+
constraints = constraints[5:]
37+
case agentConstrainConfirm:

SPECS/caddy/caddy.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Summary: Web server with automatic HTTPS
44
Name: caddy
55
Version: 2.9.1
6-
Release: 17%{?dist}
6+
Release: 18%{?dist}
77
Distribution: Edge Microvisor Toolkit
88
Vendor: Intel Corporation
99
# main source code is Apache-2.0
@@ -33,6 +33,8 @@ Patch4: CVE-2025-22872.patch
3333
Patch5: CVE-2025-58181.patch
3434
Patch6: CVE-2025-61727.patch
3535
Patch7: CVE-2025-61729.patch
36+
Patch8: CVE-2025-47913.patch
37+
Patch9: CVE-2025-47914.patch
3638
# https://github.com/caddyserver/caddy/commit/2028da4e74cd41f0f7f94222c6599da1a371d4b8
3739
BuildRequires: golang >= 1.24.4
3840
BuildRequires: golang < 1.25
@@ -455,6 +457,9 @@ fi
455457
%{_datadir}/fish/vendor_completions.d/caddy.fish
456458

457459
%changelog
460+
* Fri Jan 23 2026 Shalini Singhal <shalinix.singhal@intel.com> - 2.9.1-18
461+
- Include patch for CVE-2025-47913, CVE-2025-41914
462+
458463
* Tue Jan 22 2026 Polmoorx shiva kumar <polmoorx.shiva.kumar@intel.com> - 2.9.1-17
459464
- Include patch for CVE-2025-61727, CVE-2025-61729
460465

0 commit comments

Comments
 (0)