
I Treat Every GitHub Repo as Hostile Until Checked
I treat every GitHub repo as hostile until I’ve checked it. 2025 gave plenty of reasons:
- Kaspersky’s GitVenom research found hundreds of fake GitHub projects carrying remote access trojans, info stealers, and clipboard hijackers.
- Trend Micro tied 76 GitHub accounts to a group it calls Water Curse, which hid payloads in build scripts and project files.
- The Banana Squad campaign padded files with hundreds of spaces to push malicious code off the visible screen.
- Kaspersky found fake proof-of-concept exploit repos delivering the WebRAT backdoor, aimed at security researchers.
The xz-utils backdoor (CVE-2024-3094) showed the other side: even a long-trusted project can ship malicious code when a maintainer is the attacker.
AI agents make this worse. An agent will clone a repo, run its install script, or add an MCP server because a README told it to. Stars can be bought, and generative AI makes a convincing README cheap.
What I check before running anything
- Who published it: account age, other repos, and whether the official site links to this exact repo.
- What runs at install time: setup.py, postinstall scripts, Makefiles, .vscode tasks, and GitHub Actions. Read them before you run them.
- Signs of hiding: base64 blobs, very long lines, odd whitespace, binaries in the repo, and code that downloads more code.
- Dependencies: scan them for known vulnerabilities with OSV-Scanner, Trivy, or npm/pip audit, then lock them by hash.
- Pin what you reviewed. I pin my static site generator to a specific commit and verify its tag object, and my Python dependencies install from hash-locked files. An update means a new review.
- First run in a throwaway VM or container, with no credentials mounted and outbound traffic blocked or logged.
- MCP servers and agent plugins get the same treatment. They run with your permissions, and your model trusts what they tell it.
This is the same supply chain discipline I’d apply to an RMF baseline, pointed at the tools on my own laptop.
Deep dive
An open repository gives me code I can inspect. It also gives an attacker a place to publish an installer, build script, or convincing proof of concept. I check what will run, where it came from, and which permissions it receives before I hand it to an agent or execute it myself.
What the incidents showed
- GitVenom: Kaspersky documented fake projects that used polished descriptions and inflated activity to draw users toward stealers, remote-access tools, and clipboard hijackers. Some payloads hid in project build files.
- Water Curse: Trend Micro reported weaponized repositories associated with at least 76 accounts. The payloads appeared in build scripts and project files, where compilation could trigger them.
- Banana Squad: ReversingLabs described trojanized projects posing as security tools. It also discussed a related sample that used long stretches of whitespace to push malicious code out of the visible portion of a line.
- WebRAT: Kaspersky found repositories presenting malware as vulnerability exploits. The detailed descriptions gave the downloads a security-research appearance.
- xz: The CVE-2024-3094 record describes malicious code in upstream release archives. The build process extracted a concealed object and modified library functions. A familiar project can have a compromised release.
These are reported external incidents. I am not claiming they occurred on my machine. They explain why repository popularity, a detailed README, and a successful build are weak substitutes for inspecting the code and its origin.
Check before you run
I inspect a repository in a disposable environment with no personal credentials mounted. The commands below read metadata or scan an existing checkout; they do not run its install scripts. Set REPO to the repository identifier and run local Git and scan commands from the checkout under review. GitHub queries and vulnerability scanners use the network. Tools may create caches or logs, and audit requests can disclose dependency metadata to a registry.
Check the publisher and activity.
gh repo view "$REPO" --json nameWithOwner,owner,createdAt,updatedAt,url
git log --format='%aI %an %h %s' -n 20
git log --reverse --format='%aI %h %s' -n 1
Repository creation and commit dates are clues, not proof of an account’s age or a genuine history. Git timestamps can be forged. Check the owner’s profile and confirm the project through the publisher’s official channel. Look at who made substantive changes and whether the history makes sense.
Look for obfuscation and long lines.
grep -RInE 'base64|b64decode|fromBase64String' .
grep -RInE '.{300,}' .
These searches can produce many benign matches and miss encoded or split payloads. Review hits in context, including whitespace and generated files. A long line or an encoding call is a reason to inspect, not a malware verdict. Binary files and ignored locations need separate review.
Find execution entry points.
find . -name setup.py -o -name package.json -o -name Makefile -o -name tasks.json -o -path '*/.github/workflows/*'
Read the matching files before using them. Check package lifecycle scripts, editor tasks, build targets, workflow actions, downloads, and commands that launch other code. A file named by this search is only a starting point; an installer can invoke additional files and dependencies.
Scan known dependency vulnerabilities.
osv-scanner scan source .
trivy fs .
npm audit --ignore-scripts
Run the npm command only for a relevant Node project with its lockfile. Scanner versions and configuration affect coverage, and clean results do not rule out an intentionally malicious new package. npm audit sends dependency information to the configured registry; do not use npm audit fix during a read-only review. Scanners can download databases and write caches, so use a disposable environment if the machine must remain unchanged.
After static review, I pin the reviewed version and test only in a throwaway VM or container with no credentials and with outbound access blocked or monitored. A container needs a sensible isolation policy; its presence alone does not make untrusted code safe.
What my agents are allowed to do
My homelab’s agent-environment planning record identifies AgentAvow as a scan-before-connect gate for future installs and calls for a scan before selected tools are vendored. That record describes the planned control and does not by itself prove every client currently enforces it. I treat a scanner’s finding as evidence for a decision, not permission to connect automatically.
For this site’s Astro install, I use --ignore-scripts to suppress package lifecycle scripts during installation. This is a project-specific practice. The flag does not make a dependency trustworthy.
My site’s workflow pins its GitHub Actions to full commit SHAs. That makes the selected action revision explicit for review. I still inspect updates and dependencies: pinning preserves a chosen version, including any defect in that version. My original post also records a commit-pinned static-site generator and hash-locked Python dependencies.