News for hackers. Stuff that matters.
Re:Show HN: "Git who" – A new CLI tool for industrial-scale ... by mmcclimon on Tuesday March 18, 2025 @06:02PM (#43405698)
> You can invoke git-who as git who by setting up an alias in your global Git config

This works even without the alias, by the way: by default `git whatever` will search your path for `git-whatever` and execute it.

Re:Show HN: "Git who" – A new CLI tool for industrial-scale ... by chatmasta on Tuesday March 18, 2025 @07:35PM (#43406535)
Has this behavior been the source of exploits in the past? Something about it feels dangerously presumptuous to me.
Re:Show HN: "Git who" – A new CLI tool for industrial-scale ... by mdaniel on Tuesday March 18, 2025 @09:14PM (#43407303)
I am guessing it only resorts to that expansion if it dosesn't _already_ know about the command, because $(printf '#!/bin/sh\necho pwned\n' > /bin/git-status; chmod 755 /bin/git-status; git status) results in the thing happening that you'd expect, not a mysterious message

FWIW, both brew and kubectl also have adopted this behavior (of $(basename)-plugin style verb extensions) so I find it unlikely they'd all do it if it was a straight-up facepalm

Re:Show HN: "Git who" – A new CLI tool for industrial-scale ... by igorbark on Tuesday March 18, 2025 @09:30PM (#43407413)
probably adding a confirmation message the first time the alias is used for each command would be good, it would be nice to know when i'm invoking git and when i'm invoking a third party binary regardless of any exploit attempts!
Re:Show HN: "Git who" – A new CLI tool for industrial-scale ... by account42 on Wednesday March 19, 2025 @05:53AM (#43409960)
If malicious code ends up in your $PATH you have much bigger problems than git having a seamless plugin architecture.
Re:Show HN: "Git who" – A new CLI tool for industrial-scale ... by weebst on Tuesday March 18, 2025 @06:58PM (#43406205)
Wow! I had no idea. Will need to update the README. Thanks for the tip!
Re:Show HN: "Git who" – A new CLI tool for industrial-scale ... by jeff_carr on Thursday March 20, 2025 @07:43AM (#43421862)
Yes, that is awesome. I wonder if "go" works like that also?