From 8bec61fa94e504abecd8258ad20fb14c718f068c Mon Sep 17 00:00:00 2001 From: Acts1631 Date: Thu, 12 Nov 2026 19:24:03 -0500 Subject: [PATCH] reject malformed bracketed mount sources A bracketed IPv6 source without a colon after its closing bracket made find_base_path() advance past the source terminator. The resulting out-of-bounds base path could disclose adjacent heap contents to the remote server. Require the delimiter immediately after the closing bracket before consuming it. --- sshfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sshfs.c b/sshfs.c index 4cdf1223..627fcfea 100644 --- a/sshfs.c +++ b/sshfs.c @@ -4215,6 +4215,10 @@ static char *find_base_path(void) } *d++ = *s; } + if (s[1] != ':') { + fprintf(stderr, "missing ':' after hostname\n"); + exit(1); + } } else { *d++ = *s; }