I read about a recruiting scam that bundled documents and a project in a ZIP with a hidden Git directory. How could that lead to code execution without running an installer, and what should I check before opening a project like that?
Can a job offer ZIP run malicious code just by opening a Git project?
Answers
Git has features that can run external programs, including filters and hooks. A repository supplied as a ZIP can bring its own .git directory along, including local configuration and attribute rules that tell Git to use a filter on files.
Under the right conditions, a command as ordinary as git status can invoke a configured clean filter. An editor or a terminal prompt that automatically checks repository status could trigger Git without you typing that command yourself. It is not that every status check runs arbitrary code, but the repository configuration makes the difference.
Reply to this answer
Treat a supplied .git directory as part of the untrusted project, not as harmless metadata. The reported setup used local Git configuration, an attributes file and a script inside that directory. A custom hooks path was also configured.
If you need to investigate, inspect those files as text in an isolated environment rather than opening the folder in your usual development setup. Don't run Git commands against it just to see what happens, and be wary of tools that run Git automatically.
Reply to this answer
The recruiting pitch is worth checking separately from the technical trap. An unsolicited offer that quickly moves to a ZIP and a blank contract, without clear company or payment details, is a good reason to pause.
Verify the organization and contact through independently found channels before downloading or providing personal information. A plausible job description doesn't make the attached project safe.
Reply to this answer
If you already opened the folder in an editor or used Git on it, don't assume nothing happened just because you didn't run an installer. Disconnect the affected machine from the network and contact your security team if you have one. Preserve the archive and relevant logs for investigation rather than repeatedly opening the project.
Reply to this answer
Add your answer
Answers are reviewed before publication.
r.863~ferrulecaddy:
That distinction matters. Simply extracting the archive is not the same thing as invoking Git, although other software could act on the extracted files.