Catch malware hidden in a repo or an AI agent skill, before you install or run it.
Check a folder, a GitHub link or every repo you own. Clean what it finds and open the pull request in one command.
Documentation | Getting started | Commands | AI agent skills | GitHub Action | How it works | The story
PolinRider · What · Why · How it works · Install · Commands · Which one are you? · AI agent skills · AI review · Stay protected · Safety · FAQ · Docs · Contributing · Developer · License
PolinRider is a malware campaign that hides code inside ordinary GitHub projects. OpenSourceMalware's PolinRider project tracks it and, as of 11 April 2026, had confirmed 1,951 infected public repos belonging to 1,047 owners.
Who is behind it? The researchers attribute it to North Korea (DPRK), to a group linked to Lazarus and to the "Contagious Interview" campaign, which targets developers with fake job interviews and coding tests. forkguard has no evidence of its own about who they are: this comes from OpenSourceMalware and other security teams.
How it works. It appends obfuscated code to the end of a config file (PostCSS, Tailwind, ESLint and similar), adds a hidden init file and a node init && in your package.json scripts, or hides a task in .vscode that runs when you open the folder. Once it runs, it installs a backdoor that steals secrets and rewrites your last git commit with the original author and date, so it spreads without a trace.
It can still be running after you clean your repos. After a teammate's infected branch was built on my Mac, a hidden program kept running in the background for about an hour and a half before I found it. It lived in a hidden ~/.node_modules folder, outside every project, so scanning the repos showed nothing. If you ran an infected project, also check your machine:
ls -a ~ | grep node_modules # a hidden ~/.node_modules you did not create is a red flag
ps aux | grep "node -e" # a node process you did not startIf you find either, stop the process, then rotate every token and password that was on that computer.
forkguard is a free command line tool that does three jobs:
- Finds the PolinRider malware in your code, in a folder, in a GitHub repo (every branch, without downloading its files) or across every repo you own.
- Cleans it: removes the malware, restores your original files from git history and can open the pull request for you.
- Checks AI agent skills (Claude Code, Codex, Cursor and more) before you install them, and stops
npx skills addwhen a skill is dangerous.
It never runs the code it checks, sends nothing anywhere and has zero dependencies.
$ forkguard
forkguard my-app
HIGH init Code hidden after 776 blank spaces on line 35
HIGH package.json "dev" runs a hidden file called init before your real command
HIGH postcss.config.mjs Code hidden after 149 blank spaces on line 12
MED .gitignore Hides config.bat, a file this malware drops
4 problems found. Do not run npm install, npm run dev or open this folder in VS Code yet.
Run forkguard fix to clean it, or forkguard pr to clean it and open a pull request.
- It is invisible. The malicious code sits after hundreds of spaces at the end of an ordinary line, so your editor shows nothing. It rewrites commits without changing the author or date, so git shows nothing either.
- It runs by itself. The moment you open the folder in VS Code, or type
npm installornpm run dev, it steals your tokens, keys and saved passwords. - It spreads. It uses your stolen GitHub token to infect every repo you can push to. Recruiters' "coding tests" and old repos are the usual way in.
- AI agents make it worse. An agent told to "clone this and get it running" does exactly the dangerous thing, and a malicious skill can talk your agent into worse.
I found it in my own repos and recognised the pattern myself, and forkguard is the tool I built to find it, clean it and keep it out.
Weeks after I first cleaned it, it was back in 35 of my 53 repos. Cleaning that by hand took a whole day, so I built the tool I wished I had: the full story.
flowchart LR
A["Your code, a GitHub link,<br/>every repo you own,<br/>or an AI agent skill"] --> B["forkguard reads it<br/>and never runs it"]
B --> C{"Anything<br/>dangerous?"}
C -- "No" --> D["Looks clean"]
C -- "Yes" --> E["Shows what and where"]
E --> F["fix: restore your files<br/>pr: open the pull request<br/>skill: not installed"]
- Checking looks for every trick the malware uses and skips folders that are not your code, so a project takes well under a second. A GitHub link is read straight out of git's database and never written to your disk.
- Cleaning deletes files that are pure malware, cuts the hidden code out of your own files and puts back your exact original from git history.
- Skills are scored 0 to 100 with NVIDIA SkillSpector's rules, translated to JavaScript.
- Protecting is a few lines in your shell profile that run the check before
npm install, aftergit cloneand beforenpx skills add.
More, with diagrams: How it works.
You need Node.js 18 or newer and git.
npm install -g forkguard # once
forkguard # check this folder and every project inside it
forkguard fix # clean what it foundThat is the whole core loop. Just want to try it? npx forkguard works without installing. New to this? Getting started walks through every step.
| Command | What it does |
|---|---|
| Check (changes nothing) | |
forkguard |
Checks this folder and every project inside it |
forkguard owner/repo |
Checks a GitHub repo, every branch, without downloading its files. Links and git URLs work too |
forkguard --mine |
Checks all your repos. Public ones need no login. Add --fix to open a pull request for each infected repo |
forkguard @name |
Checks the public repos of a person or team. No login |
forkguard skills |
Checks the AI agent skills on this computer. Give it a folder or owner/repo to check one before you install it |
forkguard skills ... --ai |
Adds an AI review with your own API key: it checks each finding and looks for problems the rules cannot see |
| Clean | |
forkguard fix |
Cleans every infected project under this folder and restores your originals |
forkguard pr |
Cleans on a new branch and opens a pull request. --upstream sends it to the repo you forked from |
| Protect | |
forkguard setup |
Checks automatically before npm install and npx skills add and after git clone. --remove undoes it |
npx skills add PRODHOSH/forkguard |
Gives your AI agent the forkguard skill: every command, and when to use it |
forkguard agent |
Prints short safety rules for AI agents. --write saves them in AGENTS.md and CLAUDE.md |
Options: --json for scripts, --yes to skip questions, --all, --strict and --ai for skills, --version, --help.
Exit codes: 0 clean, 1 something dangerous, 2 forkguard could not run. FORKGUARD_SKIP=1 skips the automatic check once.
Every option explained: Commands reference.
I want to clone or fork someone's repo, or got one for a job interview
Check the link before you clone anything. This is one of the main ways the malware spreads.
forkguard someone/their-repoIt checks every branch straight from GitHub, without writing the repo's files to your disk. Clone only if it says looks clean. If it finds anything HIGH, do not clone it, do not open it, and tell the person who sent it.
Already cloned it? forkguard their-repo checks the folder before you open it or install anything.
I want to know if my own projects and repos are clean
On your laptop, open a terminal in the folder that holds your projects (for example ~/Developer):
forkguardIt checks every project inside, however deep, and changes nothing. Clean what it found with forkguard fix.
On GitHub:
forkguard --mineNot logged in? It finds your GitHub name from settings already on your computer, asks you to confirm it and checks your public repos, then shows how to log in for the private ones. To fix what it finds, forkguard --mine --fix opens one pull request per infected repo and never pushes to your main branch, so nothing changes until you merge.
To check a friend's repos: forkguard @their-name.
forkguard found something. What now?
The order matters.
- Do not run
npm installornpm run dev, and do not open the folder in VS Code. - Run
forkguard fix, orforkguard prto clean GitHub too. - From another device, change your GitHub tokens, SSH keys, npm token, cloud keys and
.envsecrets. - Block force pushes on your main branch: Settings, Rules, Rulesets.
- If it says npm itself is infected, reinstall Node.js from nodejs.org.
- Run a full antivirus scan and tell anyone else who works on the repo.
I use AI coding agents (Claude Code, Codex, Cursor...)
Give your agent the forkguard skill, once:
npx skills add PRODHOSH/forkguardFrom then on it runs npx forkguard --json before it installs, builds or opens anything it did not write, stops on exit code 1, and never runs fix or pr without asking you. Details: The forkguard skill.
Someone shared an AI skill with me, or I found one online
Look before you install:
forkguard skills owner/repoIt downloads the source to a temporary folder, reads it, deletes it and tells you if it is safe to install. With forkguard setup turned on, npx skills add owner/repo does this check automatically. Details: AI agent skills.
I never want to think about this again
npm install -g forkguard
forkguard setupOpen a new terminal. Clean projects stay silent and dangerous ones are stopped before anything runs. Add the GitHub Action and GitHub checks every push too. See Stay protected.
Skills are folders your AI agent (Claude Code, Codex, Cursor and more) follows with your permissions, so a bad one is dangerous. forkguard checks them before you install:
forkguard skills # every skill on this computer
forkguard skills owner/repo # a skill on GitHub, before you install itEach skill gets a score and a verdict (looks fine, worth a look or do not install). After forkguard setup, a dangerous npx skills add is stopped.
Add --ai to have an AI model review the findings, with your own API key (details).
Let your agent read the rules itself: npx skills add PRODHOSH/forkguard (what it says).
The skill rules come from NVIDIA SkillSpector (Apache 2.0), and all credit for them belongs to NVIDIA (NOTICE).
On your computer. Run this once, then open a new terminal:
forkguard setupFrom then on, forkguard checks a project before npm install, npm run dev and similar commands, and stops them if the project is dangerous. It also checks what comes in after git clone or git pull, and a skill before npx skills add. Everything else passes straight through, and if forkguard is missing, your command still runs.
On GitHub. Check every push and pull request with the GitHub Action:
name: forkguard
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: PRODHOSH/forkguard@v0.8.2The build fails when anything dangerous is found.
- It never runs code from the project or skill it checks. It only reads files.
- It switches off git hooks whenever it calls git, because an infected repo can ship its own.
- It never runs npm to check npm. It reads npm's files directly.
- It sends nothing anywhere. The only network calls are downloading a repo or skill you asked it to check, and talking to GitHub for
prand--mine. - Zero dependencies. Nothing sits between you and the check that could be compromised.
What it catches, rule by rule: What it checks.
Does it upload my code?
No. Everything happens on your machine. It only talks to GitHub when you ask it to check a link, check your repos, or open a pull request. The one exception is the optional
--ai review: it sends skill text to the AI provider whose key you set, tells you what first, and asks. A local model sends nothing out.
Will it slow down npm?
A typical project is checked in well under a second. Commands like
npm --version are not checked at all.
Can it check private repos?
Yes, as long as git on your machine can access them. Logging in with
gh auth login is the easiest way. Without a login, --mine checks your public repos.
What if it flags something that is fine?
Skip it once with
FORKGUARD_SKIP=1, and report a false alarm so the rule gets better. For a skill, report it here.
Does it replace antivirus?
No. It is built to catch this family of attacks very well, before code runs. Keep your antivirus too.
Why did a normal skill get a high score?
SkillSpector's static rules match words like "never judge" or "keychain" wherever they appear. Its AI review marks the ones it does not believe, but never removes them, so the score stays high. forkguard shows such a skill as "worth a look" unless something looks like a real attack. Read the findings, they show the exact text. For a second opinion, add the [AI review](#optional-ai-review).
Where do I put my API key or GitHub token?
In your terminal, as an environment variable:
export ANTHROPIC_API_KEY=..., export OPENAI_API_KEY=... or export GITHUB_TOKEN=... (PowerShell: $env:NAME = "..."). forkguard reads it from there, never saves it and never prints it. Do not put a key in the command itself, because it would be stored in your shell history. No GitHub token? gh auth login works too.
Is forkguard made by NVIDIA?
No. forkguard is an independent project. The skill rules come from NVIDIA's open source SkillSpector and all credit for them is NVIDIA's. See NOTICE.
Do I need an AI key to use forkguard?
No. Everything works offline with no key. The key is only for the optional
--ai review of skills.
Which Node versions and systems work?
Node 18, 20 and 22 and newer, on Windows, macOS and Linux, with PowerShell, Git Bash, bash and zsh. CI runs all of them.
More answers: Troubleshooting.
forkguard.pages.dev has search, a short and a plain-words version of every command, and every rule. The same pages are in docs/:
| I want to... | Read |
|---|---|
| Go from zero to protected, step by step | Getting started |
| Look up a command, option or exit code | Commands |
| Check or publish AI agent skills | AI agent skills |
| Check every push on GitHub | GitHub Action |
| Understand what happens under the hood | How it works |
Machine readable: llms.txt and llms-full.txt.
forkguard is open source and every contribution helps, from a bug report to a new rule.
- Missed something? Describe what it looked like, without pasting the malicious code.
- False alarm? Report it, or a skill false alarm.
- Want to build? Fork, branch,
npm test, open a pull request. CONTRIBUTING.md has the setup, the project map and the ground rules.
git clone https://github.com/PRODHOSH/forkguard
cd forkguard
npm test # no install step: there are no dependenciesSecurity problem in forkguard itself? Please do not open a public issue. See SECURITY.md.
|
Prodhosh V.S Built forkguard after this malware hit my own repos. prodhosh.me | hello@prodhosh.me | github.com/PRODHOSH | blog |
If forkguard saved you from a bad day, a star helps other developers find it.
Apache 2.0. Use it, change it, share it, as long as you keep the license and the credit in NOTICE.
The AI agent skill checks are derived from NVIDIA SkillSpector, Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES, also Apache 2.0. forkguard is not made or endorsed by NVIDIA.
The PolinRider campaign is documented by the OpenSourceMalware PolinRider project. forkguard is not affiliated with it.
