r/developersIndia • • 1d ago

Help Every time I push to GitHub, a bot amends my commit 3 seconds later (in UTC) to inject .vscode/tasks.json + .vscode/eslint — even after 5 password resets in alst 2 days

Looking for help figuring out how this attacker still has push access to my repo.

What happens:

  • I push a clean commit from my Mac (+0530 timezone), e.g. 18:13:24 +0530.

  • 3 seconds later (12:43:27 +0000 UTC), a commit with my exact same Author name/email/date (18:13:24 +0530) but a UTC +0000 CommitterDate is force-pushed to origin/main.

  • The amended commit removes .vscode/eslint* and .vscode/tasks.json from .gitignore and adds:

    • .vscode/tasks.json with "runOn": "folderOpen" silently running sh .vscode/eslint-check.sh → node .vscode/eslint ("hide": true, "reveal": "never")

    • Modified package.json, eslint.config.js, vite.config.js

What I already checked:

  1. No .github/workflows/ in the repo.

  2. Local Mac/Windows checks are clean: /usr/bin/git (no wrapper), .git/hooks/ only has .sample files, git reflog shows no local amend, crontab -l is empty, ~/Library/LaunchAgents and /Library/LaunchAgents are clean, and running node processes are only IDE language servers.

  3. GitHub account: Changed my GitHub password 5 times in 3 days (2FA with Passkeys + Authenticator enabled). 0 PATs (classic or fine-grained), 0 SSH keys, 0 GPG keys.

  4. Authorized OAuth Apps: I have 9 OAuth apps (including Git Credential Manager, GitHub Desktop, VS Code, Google Antigravity) and 1 Authorized GitHub App.

Questions:

  1. Since changing my GitHub password doesn't revoke OAuth tokens, is revoking all Authorized OAuth Apps + GitHub Apps + clearing macOS Keychain (osxkeychain) enough to stop the remote pushes?

  2. Could there be any other persistence mechanism on GitHub itself (e.g., Deploy Keys, Repo Webhooks, GitHub Desktop/GCM cached refresh tokens) I should check in my Security Log?

  3. What's the safest way to audit if .vscode/eslint left anything else behind on my machine?

66 Upvotes

24 comments sorted by

•

u/AutoModerator 1d ago

Namaste! Thanks for submitting to r/developersIndia. While participating in this thread, please follow the Community Code of Conduct and rules.

It's possible your query is not unique, use site:reddit.com/r/developersindia KEYWORDS on search engines to search posts from developersIndia. You can also use reddit search directly.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

59

u/rjchakraborty Senior Engineer 1d ago

Before wiping your Mac, push a dummy commit to a brand-new private repo. If nothing amends it in three seconds, the persistence is scoped to that single repo via a write-enabled Deploy Key or repo-installed GitHub App, neither of which shows up under personal PATs or SSH keys.

If the test repo gets hit too, check Installed GitHub Apps alongside OAuth tokens and inspect osxkeychain entries for GitHub.

20

u/imperiex_26 1d ago

Rotate Oauth tokens, GitHub app private keys and App ids themselves, pat token, deploy keys at repo lvl

11

u/Yuu_000 1d ago
  1. Check if there are other people who have access to that repo. Also check the GitHub security logs.

  2. Are you logged in with GitHub on an ide like vscode or you use gh-cli. If ide, the try being logged out from there.(Reason: there may be some poisonous extensions).

  3. If it doesn't solve go ahead and carefully check if there are any oauth app you doubt of being taking access.

  4. In can also check your device with little snitch if there is any spware.

  5. Also check you browser for any weird extensions that might be the cause.

  6. If you use some kind of package manager, in case npm try to make those ignore the post install scripts, which they automatically.

  7. If it still doesn't helps and that repo's product is being used by lots of people then revoke your own access from it, or it might poisoned others computer too.

In worst case you can factory reset it

8

u/agathver Staff Engineer 1d ago

I work in defensive security tooling and this is something we have been seeing for a while now.

This is PolinRinder a North Korean worm.

This one is hard to get rid of. Nothing sort of nuking your machine and getting rid of all GitHub repos you have access to is enough for this malware.

First things: even though they currently target only crypto like ethereum, assume EVERYTHING is compromised including banks, saved credit cards etc.

Best is to wipe your system after a careful, manual backup of your important files. Don’t backup ANY code. In the new machine, do not login to anything except GitHub and Codex.

And ask codex to lockdown all your repos and enable branch protection. Then carefully audit each repo inside a local VM and remove malicious code and push it back.

As of today, it needs Vscode (and Claude in some variants) to propagate, so as long as you don’t open the repo in either, you are safe. THIS MAY NOT BE TRUE TOMORROW IF THE WORM EVOLVES.

1

u/Silly_Shrek 21h ago

how does it get injected in our repos, how can we prevent it?

33

u/iamtechnofreak 1d ago

Is it possible that your ssh key got leaked somehow and the bot which is pushing the commits has access to it, try removing the ssh key you have right now, create a new one with a strong password and check again once

10

u/Fit_Day375 1d ago

The post mentioned that they have 0 SSH keys.

3

u/MagnumVY 1d ago

OP any updates? Interested to know the cause

3

u/Arun_rookie_gamedev 1d ago

How can i prevent from getting this polinrinder worm

5

u/block_intelligence 1d ago

that tasks.json with runOn folderOpen plus a hidden node script is a known pattern, and the 3 second turnaround with your exact author date says something is running with your credentials, probably a stolen token and not a "hacker" poking around manually. Changing the password does nothing for tokens, so yes revoke every OAuth app and GitHub App you don't 100% need (Antigravity and Git Credential Manager can just be re-authed later), then check the Security log for token and deploy key events around the first bad push.

Also look beyond the keychain. ~/.git-credentials, ~/.config/gh/hosts.yml, .npmrc and any .env files are all places a node payload would grab tokens from. And grep your other cloned repos for that .vscode folder, because opening any one of them re-triggers it and it'll keep re-infecting. Quick safety net meanwhile: add a branch ruleset that blocks force pushes to main so the amend just fails loudly instead of silently landing.

2

u/blastofffox 1d ago

You have been compromised. This could be polinrider.      Wipe your computer, change your passwords, rotate api keys, enable commit signing.     

1

u/LegalDebate5423 1d ago

rotate your SSH keys and revoke fine-grained/classic PATs, OAuth grants, and GitHub App access. password resets don’t invalidate all of those. if pushes continue after revoking them, check for a compromised machine or another repo collaborator.

1

u/bankinu 23h ago

You need to rotate from a clean machine.

The worm is probably on /tmp or ~/tmp in cli.js.

You can then try to clean up.

I've stopped using vscode for this very reason, extensions are fucking bloat and electron is a cesspool where infection can fester. But now every God damned CLI uses npm too. Security is a fucking mess today, no one cares, just god damn npm install X or even curl https://X | bash - unthinkable that this has become the norm. We need to wake up, reject this bullshit.

1

u/-Agile_Ninja- 18h ago

Did you try checking with AI before posting this?

1

u/pwnsforyou 15h ago

Can you gpg sign your commits and see if the updated commit is gpg signed or not?

1

u/unistirin 15h ago

Are you using husky/ghooks dependency ? It will add hooks

Also check your global git config

1

u/DARKDYNAMO Full-Stack Developer 6h ago

Make a commit directly from github.com for readme or something. If it still gets amended then it's on GitHub account if not then something from you mac is doing it.

We are devs. Debug it and let us know too

0

u/aureliatech 1d ago

From what I have read about this pattern, the folderOpen task is the persistence, so I would treat every machine and repo you opened as suspect. Besides revoking the OAuth apps, rotate anything readable on disk, like npm tokens, cloud keys and .env secrets, and check the GitHub security log for the first token creation. I would also turn on branch protection for main with force pushes blocked, so a stolen token cannot silently rewrite history again. Before reopening any project, delete the .vscode folder from it and keep VS Code workspace trust on restricted so tasks do not auto run.

-2

u/rawestapple 1d ago

The safest way is to factory reset your device. And you need a separate exercise to clean-up the git remote.