[openssh-commits] [openssh] 01/02: upstream: disallow users of forwarded agents from adding FIDO keys

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 27 08:44:55 AEDT 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 6b4f4361e463854d3d273ee43d57b9df62e6afff
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Thu Nov 26 21:35:58 2026 +0000

    upstream: disallow users of forwarded agents from adding FIDO keys
    
    to ssh-agent by default, as permitting this allows a remote user to probe
    which credentials are present on a token.
    
    A new allow-remote-fido startup option reenables the ability to do this.
    
    Anthropic ANT-2026-0LK6RYG0
    
    OpenBSD-Commit-ID: f79e6ed3610f2e47e99a66455a7c13e6db4e4a25
---
 ssh-agent.1 | 10 ++++++++--
 ssh-agent.c | 35 ++++++++++++++++++++++-------------
 2 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/ssh-agent.1 b/ssh-agent.1
index 6127c701d..efef14151 100644
--- a/ssh-agent.1
+++ b/ssh-agent.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ssh-agent.1,v 1.90 2026/10/30 07:18:18 djm Exp $
+.\" $OpenBSD: ssh-agent.1,v 1.91 2026/11/26 21:35:58 djm Exp $
 .\"
 .\" Author: Tatu Ylonen <ylo at cs.hut.fi>
 .\" Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd $Mdocdate: October 30 2026 $
+.Dd $Mdocdate: November 26 2026 $
 .Dt SSH-AGENT 1
 .Os
 .Sh NAME
@@ -135,6 +135,7 @@ environment variable).
 Specify an option when starting
 .Nm .
 The supported options are:
+.Cm allow-remote-fido ,
 .Cm allow-remote-pkcs11 ,
 .Cm no-restrict-websafe
 and
@@ -146,6 +147,11 @@ option allows clients of a forwarded
 .Nm
 to load PKCS#11 or FIDO provider libraries, and to remove PKCS#11 providers.
 By default only local clients may perform these operations.
+Similarly, the
+.Cm allow-remote-fido
+option prevents a clients of a fowarded
+.Nm
+from adding FIDO keys.
 Note that signalling that an
 .Nm
 client is remote is performed by
diff --git a/ssh-agent.c b/ssh-agent.c
index fb8367357..7c06f982c 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-agent.c,v 1.337 2026/11/26 05:42:21 djm Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.338 2026/11/26 21:35:58 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -180,10 +180,11 @@ static char *socket_dirspec;
 static char *allowed_providers;
 
 /*
- * Allows PKCS11 providers or SK keys that use non-internal providers to
- * be added over a remote connection (identified by session-bind at openssh.com).
+ * Allows PKCS11 providers or SK keys to be added over a remote connection
+ * (identified by session-bind at openssh.com).
  */
-static int remote_add_provider;
+static int remote_add_p11;
+static int remote_add_fido;
 
 /* locking */
 #define LOCK_SIZE	32
@@ -1435,15 +1436,21 @@ process_add_identity(SocketEntry *e)
 			    "authenticator-hosted key", sshkey_type(k));
 			goto out;
 		}
+		/*
+		 * Refuse remote addition of all SK keys, including those
+		 * using the internal provider: every field of the key is
+		 * passed to the local authenticator as-is, so a remote
+		 * client could otherwise probe it without user interaction.
+		 */
+		if (socket_is_remote(e) && !remote_add_fido) {
+			verbose("failed add of SK provider \"%.100s\": "
+			    "remote addition of providers is disabled",
+			    sk_provider);
+			goto out;
+		}
 		if (strcasecmp(sk_provider, "internal") == 0) {
 			debug_f("internal provider");
 		} else {
-			if (socket_is_remote(e) && !remote_add_provider) {
-				verbose("failed add of SK provider \"%.100s\": "
-				    "remote addition of providers is disabled",
-				    sk_provider);
-				goto out;
-			}
 			if (realpath(sk_provider, canonical_provider) == NULL) {
 				verbose("failed provider \"%.100s\": "
 				    "realpath: %s", sk_provider,
@@ -1648,7 +1655,7 @@ process_add_smartcard_key(SocketEntry *e)
 		goto send;
 	}
 	dump_dest_constraints(__func__, dest_constraints, ndest_constraints);
-	if (socket_is_remote(e) && !remote_add_provider) {
+	if (socket_is_remote(e) && !remote_add_p11) {
 		verbose("failed PKCS#11 add of \"%.100s\": remote addition of "
 		    "providers is disabled", provider);
 		goto send;
@@ -1724,7 +1731,7 @@ process_remove_smartcard_key(SocketEntry *e)
 	}
 	free(pin);
 
-	if (socket_is_remote(e) && !remote_add_provider) {
+	if (socket_is_remote(e) && !remote_add_p11) {
 		verbose("failed PKCS#11 remove of \"%.100s\": remote removal of "
 		    "providers is disabled", provider);
 		goto send;
@@ -2405,8 +2412,10 @@ main(int ac, char **av)
 		case 'O':
 			if (strcmp(optarg, "no-restrict-websafe") == 0)
 				restrict_websafe = 0;
+			else if (strcmp(optarg, "allow-remote-fido") == 0)
+				remote_add_fido = 1;
 			else if (strcmp(optarg, "allow-remote-pkcs11") == 0)
-				remote_add_provider = 1;
+				remote_add_p11 = 1;
 			else if ((ccp = strprefix(optarg,
 			    "websafe-allow=", 0)) != NULL) {
 				if (websafe_allowlist != NULL)

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list