From: Jeff King <peff@peff•net>
To: Junio C Hamano <gitster@pobox•com>
Cc: Collin Funk <collin.funk1@gmail•com>,
Xi Ruoyao <xry111@xry111•site>,
git@vger•kernel.org
Subject: Re: t7528-signed-commit-ssh.sh fails due to ssh-agent fails to start with ENAMETOOLONG
Date: Sat, 18 Oct 2025 05:51:25 -0400 [thread overview]
Message-ID: <20251018095125.GE1060824@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqbjm51l3a.fsf@gitster.g>
On Fri, Oct 17, 2025 at 10:42:17AM -0700, Junio C Hamano wrote:
> Jeff King <peff@peff•net> writes:
>
> > AFAICT, ssh-agent does not quote the path in its output. So for example:
> >
> > d='/tmp/has spaces'
> > mkdir "$d"
> > HOME=$d ssh-agent
> >
> > will produce:
> >
> > SSH_AUTH_SOCK=/tmp/has spaces/.ssh/agent/s.IcPuGe26YY.agent.6PtD3uhM4O; export SSH_AUTH_SOCK;
> >
> > which is nonsense to eval.
>
> So if $d were
>
> d='/tmp/has rm -rf in it'
>
> would that produce some interesting side effect?
Yep. Somewhat terrifying, though I guess if an attacker controls your
$HOME environment variable you probably have bigger worries.
-Peff
prev parent reply other threads:[~2025-10-18 9:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 1:52 t7528-signed-commit-ssh.sh fails due to ssh-agent fails to start with ENAMETOOLONG Xi Ruoyao
2025-10-17 2:06 ` Collin Funk
2025-10-17 7:09 ` Jeff King
2025-10-17 9:52 ` Lauri Tirkkonen
2025-10-17 10:54 ` Jeff King
2025-10-17 19:31 ` brian m. carlson
2025-10-18 9:56 ` Jeff King
2025-10-17 17:42 ` Junio C Hamano
2025-10-18 9:51 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251018095125.GE1060824@coredump.intra.peff.net \
--to=peff@peff$(echo .)net \
--cc=collin.funk1@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=xry111@xry111$(echo .)site \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox